mirror of
https://github.com/mm201/GamestatsBase.git
synced 2026-03-21 18:04:42 -05:00
Show stack trace in HTTP responses when DEBUG is set.
This commit is contained in:
parent
c6d41b6923
commit
7c627982fe
|
|
@ -224,11 +224,7 @@ namespace GamestatsBase
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
#if DEBUG
|
||||
ShowError(context, 500, ex.ToString());
|
||||
#else
|
||||
ShowError(context, 500);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -250,16 +246,19 @@ namespace GamestatsBase
|
|||
}
|
||||
}
|
||||
|
||||
// todo: keep the context on a field instead of passing it here
|
||||
public void ShowError(HttpContext context, int responseCode)
|
||||
public static void ShowError(HttpContext context, int responseCode)
|
||||
{
|
||||
ShowError(context, responseCode, GamestatsException.defaultMessage(responseCode));
|
||||
}
|
||||
|
||||
public void ShowError(HttpContext context, int responseCode, string message)
|
||||
public static void ShowError(HttpContext context, int responseCode, string message)
|
||||
{
|
||||
context.Response.StatusCode = responseCode;
|
||||
#if DEBUG
|
||||
context.Response.Write(message);
|
||||
#else
|
||||
context.Response.Write(GamestatsException.defaultMessage(responseCode));
|
||||
#endif
|
||||
}
|
||||
|
||||
public virtual bool IsReusable
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user