Beispiel #1
0
        public static string GetMessageFromPassportPDFError(Error error, Operation.OperationType failingOperation, string fileName)
        {
            StringBuilder errorMessage = new StringBuilder();

            errorMessage.Append("(" + failingOperation.ToString());
            errorMessage.Append(") ");
            errorMessage.Append(PassportPDFErrorUtilities.GetMessageFromResultCode(error.ResultCode));
            errorMessage.Append(": ");
            errorMessage.Append(fileName);

            if (!string.IsNullOrEmpty(error.ExtResultMessage))
            {
                errorMessage.Append(" - ");
                errorMessage.Append(error.ExtResultMessage);
            }
            else if (error.ExtResultStatus != null && error.ExtResultStatus != "OK")
            {
                errorMessage.Append(" - " + FrameworkGlobals.MessagesLocalizer.GetString("status", FrameworkGlobals.ApplicationLanguage) + error.ExtResultStatus);
            }

            if (error.InternalErrorId != null && !string.IsNullOrEmpty(error.InternalErrorId))
            {
                errorMessage.Append(" - " + FrameworkGlobals.MessagesLocalizer.GetString("internal_error_id_message", FrameworkGlobals.ApplicationLanguage) + (" ") + error.InternalErrorId);
            }

            return(errorMessage.ToString());
        }
Beispiel #2
0
        public static string GetMessageFromReduceActionError(ReduceErrorInfo reduceError, string fileName)
        {
            StringBuilder errorMessage = new StringBuilder();

            errorMessage.Append("(Reduce) ");
            errorMessage.Append(PassportPDFErrorUtilities.GetErrorMessageFromReduceErrorInfo(reduceError));
            errorMessage.Append(": ");
            errorMessage.Append(fileName);

            if (!string.IsNullOrEmpty(reduceError.ExtErrorMessage))
            {
                errorMessage.Append(" - ");
                errorMessage.Append(reduceError.ExtErrorMessage);
            }

            return(errorMessage.ToString());
        }