Пример #1
0
        private string desc(LGN_CODES lng)
        {
            string ldesc = "";

            switch (expCode)
            {
            case EXP_CODES.EXP_UNKNOWN:
                if (lng.Equals(LGN_CODES.LNG_AMERICAN))
                {
                    ldesc = GENERIC_ERROR_MSG;
                }
                break;

            case EXP_CODES.EXP_CONFIG:
                if (lng.Equals(LGN_CODES.LNG_AMERICAN))
                {
                    ldesc = "There was a problem reading some parameters from the configuration file.";
                }
                break;

            case EXP_CODES.EXP_NOMATCH:
                if (lng.Equals(LGN_CODES.LNG_AMERICAN))
                {
                    ldesc = "An expected match was not found in the data.";
                }
                break;

            case EXP_CODES.EXP_REQFIELD:
                if (lng.Equals(LGN_CODES.LNG_AMERICAN))
                {
                    ldesc = "A required field is missing data.";
                }
                break;

            case EXP_CODES.EXP_NODATA:
                if (lng.Equals(LGN_CODES.LNG_AMERICAN))
                {
                    ldesc = "The data requested does not seem to be available, please recheck the input values.";
                }
                break;

            case EXP_CODES.EXP_DUPDATA:
                if (lng.Equals(LGN_CODES.LNG_AMERICAN))
                {
                    ldesc = "The data to be created or changed already exists in the system and does not allow duplicate entries.";
                }
                break;

            case EXP_CODES.EXP_OUTRANGE:
                if (lng.Equals(LGN_CODES.LNG_AMERICAN))
                {
                    ldesc = "The input data is outside the range of allowable values or is too large to be processed by the system.";
                }
                break;

            case EXP_CODES.EXP_NOT_ALLOWED:
                if (lng.Equals(LGN_CODES.LNG_AMERICAN))
                {
                    ldesc = "The action is not allowed for this customer.";
                }
                break;

            case EXP_CODES.EXP_TRANS:
                if (lng.Equals(LGN_CODES.LNG_AMERICAN))
                {
                    ldesc = "Unable to perform all the actions needed to complete the transaction.";
                }
                break;

            case EXP_CODES.EXP_PREG:
                if (lng.Equals(LGN_CODES.LNG_AMERICAN))
                {
                    ldesc = "Please properly register the application before using the services.";
                }
                break;

            case EXP_CODES.EXP_EXPIRED:
                if (lng.Equals(LGN_CODES.LNG_AMERICAN))
                {
                    ldesc = "The data has expired and cannot be used.";
                }
                break;

            case EXP_CODES.EXP_PARSE_FAIL:
                if (lng.Equals(LGN_CODES.LNG_AMERICAN))
                {
                    ldesc = "The input data failed to parse into something usable.";
                }
                break;

            case EXP_CODES.EXP_AUTH_FAIL:
                if (lng.Equals(LGN_CODES.LNG_AMERICAN))
                {
                    ldesc = "The credentials supplied do not match any on record.";
                }
                break;

            case EXP_CODES.EXP_NOREF:
                if (lng.Equals(LGN_CODES.LNG_AMERICAN))
                {
                    ldesc = "The Reference Table requested does not exist.  Check that the application was installed correctly.";
                }
                break;

            case EXP_CODES.EXP_MAX_CALLS:
                if (lng.Equals(LGN_CODES.LNG_AMERICAN))
                {
                    ldesc = "Maximum allowed calls to the Web Service exceeded.";
                }
                break;

            case EXP_CODES.EXP_TS_FAIL:
                if (lng.Equals(LGN_CODES.LNG_AMERICAN))
                {
                    ldesc = "Table Storage unable to process request.";
                }
                break;

            case EXP_CODES.EXP_TS_SIZE:
                if (lng.Equals(LGN_CODES.LNG_AMERICAN))
                {
                    ldesc = "Table Storage unable to store data, it is too large.";
                }
                break;

            case EXP_CODES.EXP_WEB_GEN:
                if (lng.Equals(LGN_CODES.LNG_AMERICAN))
                {
                    ldesc = "The Web Request to the external web service failed.";
                }
                break;

            case EXP_CODES.EXP_WEB_NOMATCH:
                if (lng.Equals(LGN_CODES.LNG_AMERICAN))
                {
                    ldesc = "The Web Request query found no match.";
                }
                break;

            case EXP_CODES.EXP_WEB_ALTKEY:
                if (lng.Equals(LGN_CODES.LNG_AMERICAN))
                {
                    ldesc = "The Web Request used an alternate key.";
                }
                break;

            case EXP_CODES.EXP_WEB_NODATA:
                if (lng.Equals(LGN_CODES.LNG_AMERICAN))
                {
                    ldesc = "The Web Request returned less data than expected.";
                }
                break;

            case EXP_CODES.EXP_API_LIMIT:
                if (lng.Equals(LGN_CODES.LNG_AMERICAN))
                {
                    ldesc = "The API limit for this invocation exceeded.";
                }
                break;

            case EXP_CODES.EXP_SYS_DBDOWN:
                if (lng.Equals(LGN_CODES.LNG_AMERICAN))
                {
                    ldesc = "The Database is not currently responding.";
                }
                break;

            default:
                if (lng.Equals(LGN_CODES.LNG_AMERICAN))
                {
                    ldesc = "No matching description for error.";
                }
                break;
            }
            if (expDetail == "No Detail Available" && httpStat != HttpStatusCode.OK)
            {
                expDetail = "HTTP Status " + httpStat.ToString() + "(" + (int)httpStat + ")";
            }

            return(ldesc + " - " + expDetail);
        }
Пример #2
0
 public string codeDesc(LGN_CODES language)
 {
     return(desc(language));
 }