// functions public CTFTPMessageOutError(EErrorCode error_code, string error_string) { // save passed this.m_error_code = error_code; this.m_error_string = error_string; // allocate the buffer this.m_buffer_length = (2 + 2 + error_string.Length + 2); this.m_buffer = new byte[this.m_buffer_length]; // set the opcode ushort opcode = Utilities.htons((ushort)(this.Opcode)); Array.Copy(BitConverter.GetBytes(opcode), 0, this.m_buffer, 0, 2); // set the error_code ushort ec = Utilities.htons((ushort)(error_code)); Array.Copy(BitConverter.GetBytes(ec), 0, this.m_buffer, 2, 2); // set the error string Array.Copy(Encoding.ASCII.GetBytes(error_string), 0, this.m_buffer, 4, error_string.Length); // terminate it with a 0 this.m_buffer[2 + 2 + error_string.Length + 1] = 0; }
public void LogError(EErrorCode inErrorCode, string inText, int inLineNumber) { _error_count++; string text = string.Format("{0} [{3}]. [{1}]: {2}", inErrorCode, inLineNumber, inText, _parsing_file); _printer.LogError(text); }
public CMemoryString(string value, CKey parent, int line_number, EErrorCode error_code) { Value = value; Parent = parent; _line_number = line_number; _error_code = error_code; }
////////////////////////////////游戏事件响应//////////////////////////////////// //登录失败 void LoginFail(EErrorCode errorCode) { mPlayAnimate.enabled = true; mPlaySubmitBtn.gameObject.SetActive(true); GameObject.DestroyImmediate(mPlayEffect.gameObject); }
public void LogError(EErrorCode inErrorCode, CKey inKey) { _error_count++; string text = string.Format("{0} [{1}].", inErrorCode, inKey.GetPath()); _printer.LogError(text); }
/// <summary>Convert the Win32 error code to a string</summary> private static string ReasonCodeToString(EErrorCode reason_code) { switch (reason_code) { default: return($"Unspecified virtualMIDI-error: {reason_code}"); case EErrorCode.OLD_WIN_VERSION: return("Your Windows-version is too old for dynamic MIDI-port creation."); case EErrorCode.INVALID_NAME: return("You need to specify at least 1 character as MIDI-port name!"); case EErrorCode.ALREADY_EXISTS: return("The name for the MIDI-port you specified is already in use!"); case EErrorCode.ALIAS_EXISTS: return("The name for the MIDI-port you specified is already in use!"); case EErrorCode.PATH_NOT_FOUND: return("Possibly the teVirtualMIDI-driver has not been installed!"); case EErrorCode.MOD_NOT_FOUND: return("The teVirtualMIDIxx.dll could not be loaded!"); case EErrorCode.REVISION_MISMATCH: return("The teVirtualMIDIxx.dll and teVirtualMIDI.sys driver differ in version!"); case EErrorCode.TOO_MANY_SESS: return("Maximum number of ports reached"); case EErrorCode.INVALID_HANDLE: return("Port not enabled"); case EErrorCode.TOO_MANY_CMDS: return("MIDI-command too large"); case EErrorCode.BAD_ARGUMENTS: return("Invalid flags specified"); } }
public void LogError(EErrorCode inErrorCode, CToken inToken) { _error_count++; string text = string.Format("{0} [{3}]. Token {1}. Position {2}", inErrorCode, inToken, inToken.Position, _parsing_file); _printer.LogError(text); }
public void LogError(EErrorCode inErrorCode, CTokenLine inLine) { _error_count++; string text = string.Format("{0} [{2}]. Line {1}.", inErrorCode, inLine, _parsing_file); _printer.LogError(text); }
public static void ThrowCustomException(HttpStatusCode httpStatusCode, EErrorCode errorCode, string message) { throw new HttpResponseException(new HttpResponseMessage { StatusCode = httpStatusCode, Content = new StringContent("{\"ErrorCode\": " + errorCode.GetValue() + ",\"Message\": \"" + message + "\"}", Encoding.Default, "application/json") }); }
void RegisterResult(EErrorCode m_n32ErrorId) { if (m_n32ErrorId == EErrorCode.eEC_NULLNickName) { ShowTip(nullName); } MsgInfoManager.Instance.ShowMsg((int)m_n32ErrorId); noPass.gameObject.SetActive(true); pass.gameObject.SetActive(false); }
public static ResponseDto CreateErrorResponseDto(EErrorCode errorCode, string errorMessage) { return(new ResponseDto { Status = EResponseStatus.Error, Error = new ErrorDto { ErrorCode = errorCode, ErrorMessage = errorMessage } }); }
// functions public CTFTPMessageInError(byte[] buffer, int buffer_length) { // no need to get opcode as it was already decoded to get to this function // so also skip the buffer past it int buffer_index = 2; // extract error code ushort error_code = BitConverter.ToUInt16(buffer, 2); error_code = Utilities.ntohs(error_code); this.m_error_code = (EErrorCode)(error_code); buffer_index += 2; // extract error string this.m_error_string = ""; while (buffer[buffer_index] != 0) { this.m_error_string += Encoding.ASCII.GetString(buffer, buffer_index, 1); ++buffer_index; } }
/// <summary>Convert tradee error codes to CAlgo error codes</summary> public static ErrorCode ToTradeeErrorCode(this EErrorCode code) { switch (code) { default: throw new Exception("Unknown error code"); case EErrorCode.Failed: return(ErrorCode.TechnicalError); case EErrorCode.InsufficientFunds: return(ErrorCode.NoMoney); case EErrorCode.EntityNotFound: return(ErrorCode.EntityNotFound); case EErrorCode.InvalidVolume: return(ErrorCode.BadVolume); case EErrorCode.MarketClosed: return(ErrorCode.MarketClosed); case EErrorCode.Disconnected: return(ErrorCode.Disconnected); case EErrorCode.Timeout: return(ErrorCode.Timeout); } }
public static string tftp_error_code_to_string(EErrorCode error_code) { switch (error_code) { case EErrorCode.UNDEFINED: { return("TFTP_ERROR_UNDEFINED"); } case EErrorCode.ACCESS_VIOLATION: { return("TFTP_ERROR_ACCESS_VIOLATION"); } case EErrorCode.DISK_FULL: { return("TFTP_ERROR_DISK_FULL"); } case EErrorCode.FILE_ALREADY_EXISTS: { return("TFTP_ERROR_FILE_ALREADY_EXIST"); } case EErrorCode.FILE_NOT_FOUND: { return("TFTP_ERROR_FILE_NOT_FOUND"); } case EErrorCode.ILLEGAL_OPERATION: { return("TFTP_ERROR_ILLEGAL_OPERATION"); } case EErrorCode.NO_SUCH_USER: { return("TFTP_ERROR_NO_SUCH_USER"); } case EErrorCode.TERMINATE_OPTIONS: { return("TFTP_ERROR_TERMINATE_OPTIONS"); } case EErrorCode.UNKNOWN_TRANSFER_ID: { return("TFTP_ERROR_UNKNOWN_TRANSFER_ID"); } } return("TFTP_ERROR_UNKNOWN"); }
static void LogError(ILogger inLogger, EErrorCode inErrorCode, CToken inToken) { string s = string.Format("{0}: {1} [{2}-{3}]", inErrorCode, inToken, inToken.StartLineIndex, inToken.EndLineIndex); inLogger.LogError(s); }
static void LogError(ILogger inLogger, EErrorCode inErrorCode, string inText) { string s = string.Format("{0}: {1}", inErrorCode, inText); inLogger.LogError(s); }
private void EventError(EErrorCode arg1) { MsgInfoManager.Instance.ShowMsg((int)arg1); }
public LogonResult(EErrorCode pErrorCode = EErrorCode.Success) { mErrorCode = (uint)pErrorCode; }
void BeginBattleError(EErrorCode m_n32ErrorId) { MsgInfoManager.Instance.ShowMsg((int)m_n32ErrorId); }
void GameOverError(EErrorCode errorCode) { }
public static void ThrowCustomConflictException(EErrorCode errorCode, string message) { ThrowCustomException(HttpStatusCode.Conflict, errorCode, message); }
public PoloniexException(EErrorCode code, string message) : base(message) { ErrorCode = code; }
public static ResponseWithDataDto <TData> CreateErrorResponseWithDataDto <TData>(EErrorCode errorCode, string errorMessage) { return(new ResponseWithDataDto <TData> { Response = CreateErrorResponseDto(errorCode, errorMessage), Data = default(TData) }); }
/// <summary>Constructor</summary> /// <param name="errorCode">Error code associated with the exception</param> /// <param name="message">Error message</param> public SnmpException(EErrorCode errorCode, string message) : base(message) { ErrorCode = errorCode; }
/// <summary>Constructor</summary> /// <param name="errorCode">Error code associated with the exception</param> /// <param name="message">SNMP Exception message</param> /// <param name="innerException">Inner exception</param> public SnmpException(EErrorCode errorCode, string message, System.Exception innerException) : base(message, innerException) { ErrorCode = errorCode; }
public BittrexException(EErrorCode code, string message) : base(message) { ErrorCode = code; }
public Evaluation(EErrorCode code, EError?innerError = null) : this(null, new EError(code, innerError)) { }
public Exception(EErrorCode reason_code) : base(ReasonCodeToString(reason_code)) { ReasonCode = reason_code; }
void StartSelfResult(EErrorCode m_n32ErrorId) { switch (m_n32ErrorId) { case EErrorCode.eEC_AddBattleFailForAllFull: //消 MsgInfoManager.Instance.ShowMsg((int)m_n32ErrorId); if (FrameTips != null) { DestroyImmediate(FrameTips); FrameTips = null; } break; case EErrorCode.eEC_AddBattleFailForUserFull: //弹 if (FrameTips == null) { FrameTips = GameDefine.GameMethod.CreateWindow(GameConstDefine.FrameTips, Vector3.zero, transform); Tips = FrameTips.AddComponent <UIFrameTips>(); } if (FrameTips != null) { Tips.SetSendMsg(RoomNumberLabel.text, RoomPassWordLabel.text, lenth); } break; default: MsgInfoManager.Instance.ShowMsg((int)m_n32ErrorId); break; } //MsgConfigInfo msg = ConfigReader.GetMsgInfo((int)m_n32ErrorId); //if (msg != null) // MsgInfoManager.Instance.ShowMsg((MsgInfoManager.MsgType)msg.msgType, (int)m_n32ErrorId); //switch (m_n32ErrorId) { //case EErrorCode.eEC_TheBattleUserFull: // SetTipsName("人满了"); // break; //case EErrorCode.eEC_NullBattle: // SetTipsName("没有这个房间"); // break; //case EErrorCode.eEC_BattlePDWNotMatch: // SetTipsName("密码不对"); // break; //case EErrorCode.eEC_JustInBattle: // SetTipsName("JustInBattle"); // break; //case EErrorCode.eEC_NullUser: // SetTipsName("NullUser"); // break; //case EErrorCode.eEC_InvalidBattleState: // SetTipsName("无效的房间状态"); // break; //case EErrorCode.eEC_InvalidBattlePos: // SetTipsName("InvalidBattlePos"); // break; //case EErrorCode.eEC_InvalidMapID: // SetTipsName("InvalidMapID"); // break; //} }
public static bool IsError(this EError?error, EErrorCode errorCode) { return(IsError(error, errorCode.ToString())); }