Ejemplo n.º 1
0
        private string getCmdDescription(errorCode code)
        {
            switch (code) // 0x: ok, 1x: can't execute, 2x: error while executing
            {
            case errorCode.Success: return("Command completed with success.");

            case errorCode.NotAuthorized: return("You're not authorized to access to this ressource.");

            case errorCode.NotFound: return("Command not found.");

            case errorCode.OutputTooBig: return("The output too big to be display.");

            case errorCode.FormatError: return("The command isn't correctly formated.");

            case errorCode.WrongNbOfArgs: return("Wrong number of arguments for this command.");

            case errorCode.SudoRequired: return("You must launch the console in sudo mode to do this.");

            case errorCode.WrongFileExtension: return("This file don't have the correct file extension for this command.");

            case errorCode.DirectoryNotFound: return("The directory specified was not found");

            case errorCode.FileNotFound: return("The file was not found");

            case errorCode.UnknowError: return("Unidentified error.");

            default: return("Invalid error code.");
            }
        }
Ejemplo n.º 2
0
    protected void sendError(errorCode code)
    {
        error = true;
        sec   = 0;
        status.SetActive(true);
        changeColor(Color.red);

        switch (code)
        {
        case errorCode.NAME_EMPTY:
            changeText("The meal name is empty!");
            break;

        case errorCode.NAME_CONTAINS_BAR:
            changeText("The meal name should not contain a \"-\"");
            break;

        case errorCode.CAL_EMPTY:
            changeText("The meal calories field is empty!");
            break;

        case errorCode.FAT_EMPTY:
            changeText("The meal fat field is empty!");
            break;

        case errorCode.PROTEIN_EMPTY:
            changeText("The meal protein field is empty!");
            break;

        case errorCode.CARBS_EMPTY:
            changeText("The meal carbs field is empty!");
            break;

        case errorCode.INVALID_MEAL:
            changeText("Please choose a valid meal!");
            break;

        case errorCode.NEGATIVE_INPUT:
            changeText("No negative numbers!");
            break;

        case errorCode.NO_NUM_INPUT:
            changeText("Numbers only allowed!");
            break;

        case errorCode.ZERO_INPUT:
            changeText("Serving should not be 0!");
            break;
        }
    }
 public IncorrectFactorizationException(errorCode ec)
 {
     error = ec;
 }
Ejemplo n.º 4
0
 : base(message, inner) => SetHResult(errorCode, familyCode);