Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SchemaValidationException"/> class
 /// with information describing an error encountered while reading a JSON schema.
 /// </summary>
 /// <param name="jToken">
 /// The token on which the error was encountered.
 /// </param>
 /// <param name="errorNumber">
 /// The error number.
 /// </param>
 /// <param name="args">
 /// A set of values which are to be formatted along with the error number to construct
 /// an error message.
 /// </param>
 public SchemaValidationException(JToken jToken, ErrorNumber errorNumber, params object[] args)
     : this()
 {
     JToken      = jToken;
     ErrorNumber = errorNumber;
     Args        = args;
 }
Exemplo n.º 2
0
        private static Rule MakeRule(ErrorNumber errorNumber, string fullDescription, string messageFormat)
        {
            string messageStringWithPath = string.Format(CultureInfo.CurrentCulture, RuleResources.ErrorMessageStringWithPath, messageFormat);

            return(new Rule
            {
                Id = ResultFactory.RuleIdFromErrorNumber(errorNumber),
                Configuration = new RuleConfiguration
                {
                    DefaultLevel = RuleConfigurationDefaultLevel.Error
                },
                Name = new Message
                {
                    Text = errorNumber.ToString()
                },
                FullDescription = new Message
                {
                    Text = fullDescription
                },
                MessageStrings = new Dictionary <string, string>
                {
                    [DefaultRuleMessageId] = messageStringWithPath
                }
            });
        }
Exemplo n.º 3
0
 public ReportError(ErrorNumber No, string Position, string Description, bool HasComment = false)
 {
     this.No          = No;
     this.Name        = Repository.EnumHelper.GetEnumDesc(No).ToString();
     this.Position    = Position;
     this.Description = Description;
     this.HasComment  = HasComment;
 }
Exemplo n.º 4
0
        public static void CaptureError(
            this JsonSerializer serializer,
            JToken jToken,
            ErrorNumber errorNumber,
            params object[] args)
        {
            var exception = new SchemaValidationException(jToken, errorNumber, args);

            serializer.TraceWriter.Trace(TraceLevel.Error, exception.Message, exception);
        }
Exemplo n.º 5
0
        public static Result CreateResult(JToken jToken, ErrorNumber errorNumber, object[] args)
        {
            IJsonLineInfo lineInfo = jToken;

            return(CreateResult(
                       lineInfo.LineNumber,
                       lineInfo.LinePosition,
                       jToken.Path,
                       errorNumber,
                       args));
        }
Exemplo n.º 6
0
        private static string MakeErrorMessage(
            int startLine,
            int startColumn,
            string jsonPath,
            ErrorNumber errorNumber,
            params object[] args)
        {
            var result = ResultFactory.CreateResult(startLine, startColumn, jsonPath, errorNumber, args)
                         .SetResultFile(TestUtil.TestFilePath);

            return(result.FormatForVisualStudio(RuleFactory.GetRuleFromErrorNumber(errorNumber)));
        }
Exemplo n.º 7
0
 /// <summary>
 /// Class内のReturnCodeの内容を返却する
 /// </summary>
 /// <param name="errorCode">エラーコード</param>
 /// <returns>エラーコード定義名</returns>
 public string GetErrorCode(int errorCode)
 {
     try
     {
         ErrorNumber en = (ErrorNumber)Enum.ToObject(typeof(ErrorNumber), errorCode);
         return(en.ToString());
     }
     catch
     {
         throw;
     }
     return(string.Empty);
 }
Exemplo n.º 8
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hash = 17;
         hash = hash * 23 + (ErrorLine == null ? 0 : ErrorLine.GetHashCode());
         hash = hash * 23 + (ErrorMessage == null ? 0 : ErrorMessage.GetHashCode());
         hash = hash * 23 + (ErrorNumber == default(int) ? 0 : ErrorNumber.GetHashCode());
         hash = hash * 23 + (ErrorProcedure == null ? 0 : ErrorProcedure.GetHashCode());
         hash = hash * 23 + (ErrorSeverity == null ? 0 : ErrorSeverity.GetHashCode());
         hash = hash * 23 + (ErrorState == null ? 0 : ErrorState.GetHashCode());
         hash = hash * 23 + (ErrorTime == default(DateTime) ? 0 : ErrorTime.GetHashCode());
         hash = hash * 23 + (UserName == null ? 0 : UserName.GetHashCode());
         return(hash);
     }
 }
Exemplo n.º 9
0
        private void InputThreadLoop(object semaphore)
        {
            Debug.Print("[Input] Running on thread {0}", Thread.CurrentThread.ManagedThreadId);
            Setup();

            // Inform the parent thread that initialization has completed successfully
            (semaphore as Semaphore).Release();
            Debug.Print("[Input] Released main thread.", input_context);

            // Use a blocking poll for input messages, in order to reduce CPU usage
            PollFD poll_fd = new PollFD();

            poll_fd.fd     = fd;
            poll_fd.events = PollFlags.In;
            Debug.Print("[Input] Created PollFD({0}, {1})", poll_fd.fd, poll_fd.events);

            Debug.Print("[Input] Entering input loop.", poll_fd.fd, poll_fd.events);
            while (Interlocked.Read(ref exit) == 0)
            {
                int         ret      = Libc.poll(ref poll_fd, 1, -1);
                ErrorNumber error    = (ErrorNumber)Marshal.GetLastWin32Error();
                bool        is_error =
                    ret < 0 && !(error == ErrorNumber.Again || error == ErrorNumber.Interrupted) ||
                    (poll_fd.revents & (PollFlags.Hup | PollFlags.Error | PollFlags.Invalid)) != 0;

                // We need to query the desktop bounds in order to position the mouse cursor correctly.
                // This value will be used for the current bunch of input events. If a monitor changes
                // resolution in the meantime, we might be slightly off in our calculations - this error
                // will be corrected when the next bunch of input events arrives.
                UpdateDisplayBounds();

                if (ret > 0 && (poll_fd.revents & (PollFlags.In | PollFlags.Pri)) != 0)
                {
                    ProcessEvents(input_context);
                }

                if (is_error)
                {
                    Debug.Print("[Input] Exiting input loop {0} due to poll error [ret:{1} events:{2}]. Error: {3}.",
                                input_thread.ManagedThreadId, ret, poll_fd.revents, error);
                    Interlocked.Increment(ref exit);
                }
            }
            Debug.Print("[Input] Exited input loop.", poll_fd.fd, poll_fd.events);
        }
Exemplo n.º 10
0
        public static Result CreateResult(
            int startLine,
            int startColumn,
            string jsonPath,
            ErrorNumber errorNumber,
            params object[] args)
        {
            Rule rule = RuleFactory.GetRuleFromErrorNumber(errorNumber);

            var messageArguments = new List <string> {
                jsonPath
            };

            messageArguments.AddRange(args.Select(a => a.ToString()));

            var result = new Result
            {
                RuleId    = rule.Id,
                Level     = rule.Configuration.DefaultLevel.ToLevel(),
                Locations = new List <Location>
                {
                    new Location
                    {
                        PhysicalLocation = new PhysicalLocation
                        {
                            Region = new Region
                            {
                                StartLine   = startLine,
                                StartColumn = startColumn
                            }
                        }
                    }
                },

                Message = new Message
                {
                    MessageId = RuleFactory.DefaultRuleMessageId,
                    Arguments = messageArguments
                },
            };

            result.SetProperty("jsonPath", jsonPath);

            return(result);
        }
Exemplo n.º 11
0
 public ReportError(ErrorNumber No, string Position, string Description)
 {
     this.No = No;
     if (No == ErrorNumber.CMA)
     {
         Name = "计量单位错误";
     }
     else if (No == ErrorNumber.Description)
     {
         Name = "描述错误";
     }
     else
     {
         Name = "待定";
     }
     this.Position    = Position;
     this.Description = Description;
 }
Exemplo n.º 12
0
 private void ThrowError(string message, ErrorNumber errorNumber)
 {
     try
     {
         throw new RestaurantException
               {
                   ErrorCode = new ErrorCode
                   {
                       ErrorMessage = message,
                       ErrorNumber  = errorNumber
                   }
               };
     }
     catch (RestaurantException ex)
     {
         throw ex;
     }
 }
Exemplo n.º 13
0
        private static ReportingDescriptor MakeRule(ErrorNumber errorNumber, string fullDescription, string messageFormat)
        {
            string messageStringWithPath = string.Format(CultureInfo.CurrentCulture, RuleResources.ErrorMessageStringWithPath, messageFormat);

            return(new ReportingDescriptor
            {
                Id = ResultFactory.RuleIdFromErrorNumber(errorNumber),
                DefaultConfiguration = new ReportingConfiguration
                {
                    Level = FailureLevel.Error
                },
                Name = errorNumber.ToString(),
                FullDescription = new MultiformatMessageString
                {
                    Text = fullDescription
                },
                MessageStrings = new Dictionary <string, MultiformatMessageString>
                {
                    [DefaultRuleMessageId] = new MultiformatMessageString {
                        Text = messageStringWithPath
                    }
                }
            });
        }
Exemplo n.º 14
0
 public static bool IsError(ErrorNumber code)
 {
     return(IsError(code.Value));
 }
 public void AddError(JToken jToken, ErrorNumber errorNumber, params object[] args)
 {
     _schemaValidationExceptions.Add(new SchemaValidationException(jToken, errorNumber, args));
 }
Exemplo n.º 16
0
 static internal HttpStatusCodeResult getHttpError(ErrorNumber errorNumber)
 {
     return(new HttpStatusCodeResult(HttpStatusCode.BadRequest, getErrorMessage(errorNumber)));
 }
Exemplo n.º 17
0
        public void EventConnectDelayed(String addr, ErrorNumber errno)
        {
            if ((m_monitorEvents & SocketEvent.ConnectDelayed) == 0)
                return;

            MonitorEvent(new MonitorEvent(SocketEvent.ConnectDelayed, addr, errno));
        }
Exemplo n.º 18
0
        static internal string getErrorMessage(ErrorNumber errorNumber)
        {
            switch (errorNumber)
            {
                #region USER DATA
            case ErrorNumber.BAD_CODE:
                return("El codigo es invalido");

            case ErrorNumber.NO_USERNAME:
                return("Por favor ingrese el usuario");

            case ErrorNumber.NO_PASSWORD:
                return("Por favor ingrese la contraseña");

            case ErrorNumber.LOGIN_FAILED:
                return("El usuario o clave son incorrectos");

            case ErrorNumber.NO_USER_REGISTERED:
                return("El usuario no se encuentra registrado");

                #endregion

                #region EVENT
            case ErrorNumber.NO_EVENTMANAGER:
                return("No existe la cuenta asociada");

            case ErrorNumber.NO_EVENT:
                return("No existe el evento");

            case ErrorNumber.NO_EVENT_NAME:
                return("El campo de nombre es obligatorio");

            case ErrorNumber.NO_EVENT_DATE:
                return("El campo de fecha es obligatorio");

            case ErrorNumber.MAX_EVENTS_REACHED:
                return("Se ha alcanzado el numero de eventos permitido");

            case ErrorNumber.EVENT_CREATE_FAIL:
                return("No fue posible crear el evento");

            case ErrorNumber.NO_EVENT_TIME:
                return("El campo de hora es obligatorio");

                #endregion

                #region PARTNER
            case ErrorNumber.PARTNER_ALREADY_EVENT:
                return("El patrocinador ya se encuentra en el evento");

            case ErrorNumber.NO_PARTNER_NAME:
                return("Por favor ingrese un nombre de patrocinador");

            case ErrorNumber.NO_CATEGORY_NAME:
                return("Por favor ingrese una categoría");

            case ErrorNumber.NO_CONTACT_NAME:
                return("Por favor ingrese un nombre de contacto");

            case ErrorNumber.NO_CONTACT_EMAIL:
                return("Por favor ingrese una direccion de correo valida");

            case ErrorNumber.NO_CONTACT_PHONE:
                return("Por favor ingrese un numero de correo valida");

            case ErrorNumber.PARTNER_NOT_EXIST:
                return("El patrocinador no se encuentra registrado");

                #endregion

                #region INVITATION
            case ErrorNumber.NO_PERSON_EMAIL:
                return("El campo de correo es obligatorio");

            case ErrorNumber.NO_PERSON_NAME:
                return("El campo de nombre es obligatorio");

            case ErrorNumber.NO_PERSON_LASTNAME:
                return("El campo de apellido es obligatorio");

            case ErrorNumber.NO_PERSON_PHONE:
                return("El campo de telefono es obligatorio");

            case ErrorNumber.NO_INVITATION_LEFT:
                return("El patrocinador no posee invitaciones");

            case ErrorNumber.NO_STAFF_LEFT:
                return("El patrocinador no posee staff Restante");

            case ErrorNumber.INVITATION_ALREADY:
                return("La persona ya ha sido invitada al evento");

            case ErrorNumber.NO_PERSON_COMPANY:
                return("El campo de empresa es obligatorio");

            case ErrorNumber.NO_PERSON_JOB:
                return("El campo de puesto es obligatorio");

            case ErrorNumber.NO_PERSON_SEX:
                return("El campo de sexo es obligatorio");

            case ErrorNumber.NO_PERSON_JOB_CATEGORY:
                return("El campo de categoria es obligatorio");

            case ErrorNumber.NO_PERSON_INDUSTRY:
                return("El campo de industria es obligatorio");

            case ErrorNumber.NO_PERSON_COUNTRY:
                return("El campo de pais es obligatorio");

            case ErrorNumber.NO_PERSON_ID:
                return("El campo de identificacion es obligatorio");

            case ErrorNumber.NO_PERSON_AGE:
                return("El campo de edad es obligatorio");

            case ErrorNumber.PERSON_NOT_EXIST:
                return("La persona no se encuentra registrada");

            case ErrorNumber.PERSON_EMAIL_ALREADY:
                return("Ya existe una persona con el correo ingresado");

            case ErrorNumber.INVITATION_ERROR:
                return("Ha ocurrido un error al crear la invitación");

            case ErrorNumber.INVITATION_TRY_AGAIN:
                return("Por favor vuelve a intentarlo");

            case ErrorNumber.CODE_ALREADY_USED:
                return("El codigo ya ha sido utilizado");

            case ErrorNumber.INVITATION_REJECTED:
                return("La persona rechazo la entrada");

            case ErrorNumber.INVITATION_EXPIRED:
                return("La invitación ha expirado");

                #endregion

                #region VISIT
            case ErrorNumber.VISIT_ALREADY:
                return("La persona ya ha visitado el stand");

                #endregion
            //Uknow errors
            case ErrorNumber.NO_INTERNET_CONECTION:
                return("No hay conexion a internet");

            case ErrorNumber.EMAIL_NO_TOADRESS:
                return("No se tiene dirección de envío");

            default:
                return("Se ha presentado un error desconocido");
            }
        }
Exemplo n.º 19
0
 public static bool IsError(ErrorNumber code)
 {
     return IsError(code.Value);
 }
Exemplo n.º 20
0
        /// <summary>
        /// handle errors
        /// </summary>
        protected void HandleErrorCode(ErrorNumber errorNumber)
        {
            try
            {
                switch (errorNumber)
                {
                case ErrorNumber.Success:
                    break;

                case ErrorNumber.NotFound:
                    throw new RestaurantException
                          {
                              ErrorCode = new ErrorCode
                              {
                                  ErrorMessage = "Object not found",
                                  ErrorNumber  = ErrorNumber.NotFound
                              }
                          };

                case ErrorNumber.Exists:
                    throw new RestaurantException
                          {
                              ErrorCode = new ErrorCode
                              {
                                  ErrorMessage = "An object with the name/nameAr already exists in the db",
                                  ErrorNumber  = ErrorNumber.Exists
                              }
                          };

                case ErrorNumber.BranchDoesNotExist:
                    throw new RestaurantException
                          {
                              ErrorCode = new ErrorCode
                              {
                                  ErrorMessage = "branch does not exist",
                                  ErrorNumber  = ErrorNumber.BranchDoesNotExist
                              }
                          };

                case ErrorNumber.UserDoesNotExist:
                    throw new RestaurantException
                          {
                              ErrorCode = new ErrorCode
                              {
                                  ErrorMessage = "User does not exist",
                                  ErrorNumber  = ErrorNumber.UserDoesNotExist
                              }
                          };

                case ErrorNumber.MealDoesNotExist:
                    throw new RestaurantException
                          {
                              ErrorCode = new ErrorCode
                              {
                                  ErrorMessage = "Meal does not exist",
                                  ErrorNumber  = ErrorNumber.MealDoesNotExist
                              }
                          };

                case ErrorNumber.OrderDoesNotExist:
                    throw new RestaurantException
                          {
                              ErrorCode = new ErrorCode
                              {
                                  ErrorMessage = "Order does not exist",
                                  ErrorNumber  = ErrorNumber.OrderDoesNotExist
                              }
                          };

                case ErrorNumber.AttributeDoesNotExist:
                    throw new RestaurantException
                          {
                              ErrorCode = new ErrorCode
                              {
                                  ErrorMessage = "attribute does not exist",
                                  ErrorNumber  = ErrorNumber.AttributeDoesNotExist
                              }
                          };

                case ErrorNumber.OrderMealDoesNotExist:
                    throw new RestaurantException
                          {
                              ErrorCode = new ErrorCode
                              {
                                  ErrorMessage = "order meal does not exist",
                                  ErrorNumber  = ErrorNumber.OrderMealDoesNotExist
                              }
                          };

                case ErrorNumber.DeliveryUserNotInOrderBranch:
                    throw new RestaurantException
                          {
                              ErrorCode = new ErrorCode
                              {
                                  ErrorMessage = "Delivery man not in order branch",
                                  ErrorNumber  = ErrorNumber.DeliveryUserNotInOrderBranch
                              }
                          };

                case ErrorNumber.UserNotBranchAdmin:
                    throw new RestaurantException
                          {
                              ErrorCode = new ErrorCode
                              {
                                  ErrorMessage = "User is not branch admin",
                                  ErrorNumber  = ErrorNumber.UserNotBranchAdmin
                              }
                          };

                case ErrorNumber.AccessDenied:
                    throw new RestaurantException
                          {
                              ErrorCode = new ErrorCode
                              {
                                  ErrorMessage = "Access Denied",
                                  ErrorNumber  = ErrorNumber.AccessDenied
                              }
                          };

                case ErrorNumber.AttributeGroupDoesNotExist:
                    throw new RestaurantException
                          {
                              ErrorCode = new ErrorCode
                              {
                                  ErrorMessage = "AttributeGroup Does Not Exist",
                                  ErrorNumber  = ErrorNumber.AttributeGroupDoesNotExist
                              }
                          };

                case ErrorNumber.GeneralError:
                    break;

                case ErrorNumber.EmptyRequiredField:
                    break;

                default:
                    break;
                }
            }
            catch (RestaurantException ex)
            {
                throw ex;
            }
        }
Exemplo n.º 21
0
 public GrpcError(ErrorNumber errorNumber) : base(errorNumber.ToString())
 {
     ErrorNumber = errorNumber;
 }
Exemplo n.º 22
0
 public static ReportingDescriptor GetRuleFromErrorNumber(ErrorNumber errorNumber)
 {
     return(s_ruleDictionary[errorNumber]);
 }
Exemplo n.º 23
0
 private void AddResult(JToken jToken, ErrorNumber errorNumber, params object[] args)
 {
     _results.Add(ResultFactory.CreateResult(jToken, errorNumber, args));
 }
Exemplo n.º 24
0
 private static string GetMessage(ErrorNumber errorNumber, string language)
 {
     return GetMessage(errorNumber.ToString(), language);
 }
Exemplo n.º 25
0
 public static void Clear()
 {
     ErrorNumber = 0;
 }
Exemplo n.º 26
0
 internal static string RuleIdFromErrorNumber(ErrorNumber errorNumber)
 {
     return(string.Format(CultureInfo.InvariantCulture, RuleFactory.ErrorCodeFormat, (int)errorNumber));
 }
Exemplo n.º 27
0
Arquivo: ZMQ.cs Projeto: knocte/netmq
 public static String ErrorText(ErrorNumber errno)
 {
     return "Errno = " + errno.Value.ToString();
 }
Exemplo n.º 28
0
 private static string GetMessage(ErrorNumber errorNumber, string language)
 {
     return(GetMessage(errorNumber.ToString(), language));
 }
Exemplo n.º 29
0
 public static Rule GetRuleFromErrorNumber(ErrorNumber errorNumber)
 {
     return(s_ruleDictionary[errorNumber]);
 }
Exemplo n.º 30
0
 public ErrorCode(string errorMessage, ErrorNumber errorNumber)
 {
     ErrorNumber  = errorNumber;
     ErrorMessage = errorMessage;
 }
Exemplo n.º 31
0
        public void EventBindFailed(String addr, ErrorNumber errno)
        {
            if ((m_monitorEvents & SocketEvent.BindFailed) == 0)
                return;

            MonitorEvent(new MonitorEvent(SocketEvent.BindFailed, addr, errno));
        }
Exemplo n.º 32
0
 public void SetResult(bool operationResult, string dataError, errorType dataErrorType, string message)
 {
     OperationResult = operationResult;
     ErrorCode       = ErrorNumber.SetType(dataError, dataErrorType);
     Message         = message;
 }
Exemplo n.º 33
0
        public JWTToken(String token)
        {
            _passed_token = token;
            valid         = false;
            String[] pieces = token.Split('.');

            if (pieces == null || pieces.Length != 3)
            {
                errorcode = ErrorNumber.INVALID_AUTHORIZATION_TOKEN_PARSE_ERROR; return;
            }

            byte[] header    = Convert.FromBase64String(pieces[0]);
            byte[] payload   = Convert.FromBase64String(pieces[1]);
            byte[] signature = Convert.FromBase64String(pieces[2]);

            try
            {
                this.header  = JsonConvert.DeserializeObject <Header>(Encoding.UTF8.GetString(header));
                this.payload = JsonConvert.DeserializeObject <Payload>(Encoding.UTF8.GetString(payload));
            } catch (/*JsonSerialization*/ Exception e)
            {
                if (e is JsonReaderException)
                {
                    JsonReaderException jre = (JsonReaderException)e;
                    if (jre.Path == "atIssued")
                    {
                        errorcode = ErrorNumber.INVALID_AUTHORIZATION_PAYLOAD_INVALID_ISSUED; return;
                    }
                    else if (jre.Path == "exp")
                    {
                        errorcode = ErrorNumber.INVALID_AUTHORIZATION_PAYLOAD_INVALID_EXPIRATION; return;
                    }
                    else
                    {
                        errorcode = ErrorNumber.INVALID_AUTHORIZATION_TOKEN_PARSE_ERROR; return;
                    }
                }
                errorcode = ErrorNumber.INVALID_AUTHORIZATION_TOKEN_PARSE_ERROR;
                return;
            }

            if (this.header == null || this.payload == null)
            {
                errorcode = ErrorNumber.INVALID_AUTHORIZATION_TOKEN_PARSE_ERROR; return;
            }

            if (this.header.alg == null || this.header.alg != "HS256")
            {
                errorcode = ErrorNumber.INVALID_AUTHORIZATION_HEADER_INVALID_ALGORITHM; return;
            }

            if (this.payload.iss == null)
            {
                errorcode = ErrorNumber.INVALID_AUTHORIZATION_PAYLOAD_NO_ISSUER; return;
            }

            if (this.payload.iss != ISSUER)
            {
                errorcode = ErrorNumber.INVALID_AUTHORIZATION_PAYLOAD_INVALID_ISSUER; return;
            }

            if (this.payload.atIssued == null)
            {
                errorcode = ErrorNumber.INVALID_AUTHORIZATION_PAYLOAD_NO_ISSUED; return;
            }

            if (this.payload.exp == null)
            {
                errorcode = ErrorNumber.INVALID_AUTHORIZATION_PAYLOAD_NO_EXPIRATION; return;
            }

            if (this.payload.atIssued.Value.ToLocalTime().CompareTo(this.payload.exp.Value.ToLocalTime()) >= 0 || this.payload.atIssued.Value.ToLocalTime().CompareTo(DateTime.Now) >= 0)
            {
                errorcode = ErrorNumber.INVALID_AUTHORIZATION_PAYLOAD_INVALID_ISSUED; return;
            }

            if (this.payload.exp.Value.ToLocalTime().CompareTo(DateTime.Now) <= 0)
            {
                errorcode = ErrorNumber.INVALID_AUTHORIZATION_TOKEN_EXPIRED; return;
            }

            HMACSHA256 hmacsha256 = new HMACSHA256((new System.Text.ASCIIEncoding()).GetBytes(SIGNING_KEY));

            byte[] computedSignature = hmacsha256.ComputeHash((new System.Text.ASCIIEncoding()).GetBytes(pieces[0] + "." + pieces[1]));
            valid = computedSignature.SequenceEqual(signature);
            if (!valid)
            {
                errorcode = ErrorNumber.INVALID_AUTHORIZATION_TOKEN_INVALID_SIGNATURE; return;
            }
        }
Exemplo n.º 34
0
 /// <summary>
 /// 返回结构体构造
 /// </summary>
 /// <param name="code"></param>
 /// <param name="message"></param>
 public ResponseStruct(ErrorNumber code, string message)
 {
     Code    = code;
     Message = message;
 }
Exemplo n.º 35
0
 public TryAgainException(string message, ErrorNumber errorNumber)
     : base(message, errorNumber)
 {
 }
Exemplo n.º 36
0
 public static string GetMessage(ErrorNumber errorNumber, string language, params object[] args)
 {
     return string.Format(GetMessage(errorNumber, language), args);
 }
Exemplo n.º 37
0
 public static string GetMessage(ErrorNumber errorNumber, string language, params object[] args)
 {
     return(string.Format(GetMessage(errorNumber, language), args));
 }
Exemplo n.º 38
0
 public static void Clear()
 {
     ErrorNumber = 0;
 }