public string GetErrorMessage(EnumErrorCodes errorCode) { switch (errorCode) { case EnumErrorCodes.FatalError: return("An unknown error has occurred."); case EnumErrorCodes.DocumentScannerNull: return("There is no avaiable scanner."); case EnumErrorCodes.UnknownError: return("An unknown error has occurred."); case EnumErrorCodes.FingerprintNull: return("fingerprint_Template can not be null."); case EnumErrorCodes.SmartCardReaderNull: return("SmartCardReader is not connected."); case EnumErrorCodes.UserNameNull: return("UserName can not be null."); case EnumErrorCodes.NRICNull: return("NRIC can not be null."); default: break; } return("Unknown error."); }
public ErrorResponse(object id, string message, EnumErrorCodes code, IEnumerable <string> errors) { Code = code; Message = message; Id = id ?? Guid.NewGuid(); Errors = errors ?? new List <string>(); }
public bool Suspend() { errorCode = EnumErrorCodes.NO_ERROR; if (scheduler == null) { MessageBox.Show("Can Not Suspend a suspended or non-existent scheduler"); return(false); } if (!scheduler.Suspend()) { MessageBox.Show("An error occurred while suspending the scheduler"); return(false); } return(true); }
/// <summary> /// This function is called to start the operating system /// </summary> /// <returns> whether any errors occurred during execution</returns> public bool Start() { errorCode = EnumErrorCodes.NO_ERROR; if (scheduler == null) { SchedulerFlags?flags = CreateSchedulerFlags(); if (flags == null) { MessageBox.Show("Could not start scheduler invalid flags"); return(false); } scheduler = new Scheduler(flags.Value); } SetClockSpeed(); if (!scheduler.Start()) { MessageBox.Show("An error occurred while running the scheduler"); return(false); } return(true); }
private void ThrowError(EnumErrorCodes errorCode, string errorMessage) { MessageBox.Show("Compile Error: " + errorCode.ToString() + " " + errorMessage); }
/// <summary> /// This function creates an error message to display /// in a message box to the user indicating what type /// of error occurred /// </summary> /// <param name="enumErrorCodes"> the error code that identifies the error</param> /// <param name="expectedToken"> the expected token</param> private void ThrowError(EnumErrorCodes enumErrorCodes, string expectedToken) { error = "Error: " + enumErrorCodes + " " + expectedToken; }
public ErrorInfo(EnumErrorCodes errorCode) { _errorCode = errorCode; }
public ErrorResponse(object id, string message, EnumErrorCodes code) : this(id, message, code, errors : null) { }
public ErrorResponse(string message, EnumErrorCodes code) : this(id : null, message, code, errors : null) { }