示例#1
0
        private String GetMessage(AsarException ex)
        {
            String result;

            switch (ex)
            {
            case AsarException.ASAR_FILE_CANT_FIND:
                result = "Error: The specified file couldn't be found.";
                break;

            case AsarException.ASAR_FILE_CANT_READ:
                result = "Error: File can't be read.";
                break;

            case AsarException.ASAR_INVALID_DESCRIPTOR:
                result = "Error: File's header size is not defined on 4 or 8 bytes.";
                break;

            case AsarException.ASAR_INVALID_FILE_SIZE:
                result = "Error: Data table size shorter than the size specified in in the header.";
                break;

            default:
                result = "Error: Unhandled exception !";
                break;
            }

            return(result);
        }
示例#2
0
 public AsarExceptions(AsarException ex, String customMessage)
 {
     _asarException = ex;
     if (customMessage.Length > 0)
     {
         _asarMessage = customMessage;
     }
     else
     {
         _asarMessage = GetMessage(ex);
     }
 }
示例#3
0
 public AsarExceptions(AsarException ex) : this(ex, "")
 {
 }