Ejemplo n.º 1
0
        private static string GetErrorMessage(Exception exception, bool showServerExceptions)
        {
            string message = exception.Message;

            if (showServerExceptions && exception.InnerException != null)
            {
                message += "\tInner Exception: " + ApiError.GetErrorMessage(exception.InnerException, showServerExceptions);
            }
            return(message);
        }
Ejemplo n.º 2
0
 public ApiError(ApiException exception, bool showServerExceptions)
 {
     if (exception == null)
     {
         throw new ArgumentNullException(nameof(exception));
     }
     this.Code    = (int)exception.ErrorCode;
     this.Message = ApiError.GetErrorMessage(exception, showServerExceptions);
     this.Data    = exception.ApiData;
 }