Пример #1
0
        /// <summary>
        /// Translates a server error code into a localized string.
        /// </summary>
        /// <param name="returnCode">The return code to translate.</param>
        /// <returns>A localized error message.</returns>
        public static string GetServerErrorMessage(GTIServerReturnCode returnCode)
        {
            string message;

            switch (returnCode)
            {
            case GTIServerReturnCode.Success:
                message = Resources.GTIServerErrorSuccess;
                break;

            case GTIServerReturnCode.GeneralError:
                message = Resources.GTIServerErrorGeneral;
                break;

            case GTIServerReturnCode.ServerBusy:
                message = Resources.GTIServerErrorBusy;
                break;

            case GTIServerReturnCode.ParamError:
                message = Resources.GTIServerErrorParam;
                break;

            case GTIServerReturnCode.SQLError:
                message = Resources.GTIServerErrorSQL;
                break;

            case GTIServerReturnCode.UnauthorizedAction:
                message = Resources.GTIServerErrorUnauth;
                break;

            case GTIServerReturnCode.StringLengthError:
                message = Resources.GTIServerErrorString;
                break;

            case GTIServerReturnCode.ErrorStartingTrans:
                message = Resources.GTIServerErrorStartTrans;
                break;

            case GTIServerReturnCode.ErrorCommitingTrans:
                message = Resources.GTIServerErrorCommitTrans;
                break;

            case GTIServerReturnCode.ErrorRollbackTrans:
                message = Resources.GTIServerErrorRollbackTrans;
                break;

            case GTIServerReturnCode.ErrorUpdatingTable:
                message = Resources.GTIServerErrorUpdateTable;
                break;

            case GTIServerReturnCode.ErrorWritingFile:
                message = Resources.GTIServerErrorWriteFile;
                break;

            case GTIServerReturnCode.MulticastError:
                message = Resources.GTIServerErrorMulticast;
                break;

            case GTIServerReturnCode.ConnectFailure:
                message = Resources.GTIServerErrorConnect;
                break;

            case GTIServerReturnCode.ResultsPending:
                message = Resources.GTIServerErrorRequestPend;
                break;

            case GTIServerReturnCode.NoPendingRequest:
                message = Resources.GTIServerErrorNoRequests;
                break;

            case GTIServerReturnCode.DuplicateTableEntry:
                message = Resources.GTIServerErrorDupTable;
                break;

            case GTIServerReturnCode.MissingTableEntry:
                message = Resources.GTIServerErrorMissingTable;
                break;

            case GTIServerReturnCode.UnableToAccessDatabase:
                message = Resources.GTIServerErrorDbAccess;
                break;

            case GTIServerReturnCode.MsgHandlerNotFound:
                message = Resources.GTIServerErrorMsgHandler;
                break;

            case GTIServerReturnCode.InsufficientRights:
                message = Resources.GTIServerErrorNoRights;
                break;

            case GTIServerReturnCode.MissingStoredProcedure:
                message = Resources.GTIServerErrorNoSProc;
                break;

            case GTIServerReturnCode.AllocMemoryFailure:
                message = Resources.GTIServerErrorMemAlloc;
                break;

            case GTIServerReturnCode.CentralServerCommError:
                message = Resources.GTIServerErrorCentralComm;
                break;

            // Rally DE4225 - Nondescript error code for card sale problems.
            case GTIServerReturnCode.CardSalesUnavailable:
                message = Resources.GTIServerErrorCardSalesUnavailable;
                break;

            case GTIServerReturnCode.InsufficientInventory:     // Rally US1283
                message = Resources.GTIServerErrorInsufficientInventory;
                break;

            //START RALLY DE8439
            case GTIServerReturnCode.InUse:
                message = Resources.GTIServerErrorInUse;
                break;
            //END RALLY DE8439

            default:
                message = Resources.GTIServerErrorUnknown;
                break;
            }

            return(message);
        }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the ServerException class with a
 /// specified return code, error message, and a reference to the
 /// inner exception that is the cause of this exception.
 /// </summary>
 /// <param name="returnCode">The return code from the server.</param>
 /// <param name="message">A message that describes the error.</param>
 /// <param name="innerException">The exception that is the cause of
 /// the current exception. If the innerException parameter is not a
 /// null reference, the current exception is raised in a catch block
 /// that handles the inner exception.</param>
 public ServerException(GTIServerReturnCode returnCode, string message, Exception innerException)
     : base(message, innerException)
 {
     m_returnCode = returnCode;
 }
Пример #3
0
        /// <summary>
        /// Translates a server error code into a localized string.
        /// </summary>
        /// <param name="returnCode">The return code to translate.</param>
        /// <returns>A localized error message.</returns>
        public static string GetServerErrorMessage(int returnCode)
        {
            GTIServerReturnCode code = (GTIServerReturnCode)returnCode;

            return(GetServerErrorMessage(code));
        }