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); }
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; }