/// <summary> /// Override to customize converting an Exception into the ResponseStatus DTO /// </summary> public virtual ResponseStatus CreateResponseStatus(Exception ex, object request = null) { var useEx = UseException(ex); var responseStatus = DtoUtils.CreateResponseStatus(useEx, request, Config.DebugMode); OnExceptionTypeFilter(useEx, responseStatus); if (Config.DebugMode || Log.IsDebugEnabled) { OnLogError(GetType(), responseStatus.Message, useEx); } return(responseStatus); }
/// <summary> /// Override to customize converting an Exception into the ResponseStatus DTO /// </summary> public virtual ResponseStatus CreateResponseStatus(Exception ex, object request = null) { var useEx = (Config.ReturnsInnerException && ex.InnerException != null && !(ex is IHttpError) ? ex.InnerException : null) ?? ex; var responseStatus = DtoUtils.CreateResponseStatus(useEx, request, Config.DebugMode); OnExceptionTypeFilter(useEx, responseStatus); if (Config.DebugMode || Log.IsDebugEnabled) { OnLogError(GetType(), responseStatus.Message, useEx); } return(responseStatus); }