Remove developer exception page in production

- Replace it with an ErrorMessage payload
- Adjust the client to account for this
This commit is contained in:
Jordan Brown
2020-01-09 20:29:14 -05:00
parent 9ca39c9ad0
commit b53562a667
4 changed files with 48 additions and 15 deletions
+5 -1
View File
@@ -112,7 +112,11 @@ namespace Tgstation.Server.Client
throw new MethodNotSupportedException();
case HttpStatusCode.InternalServerError:
// response json is html
throw new ServerErrorException(json);
throw new ServerErrorException(errorMessage ?? new ErrorMessage
{
Message = "An internal server error occurred!",
SeverApiVersion = null
}, response.StatusCode);
case (HttpStatusCode)429:
// rate limited
response.Headers.TryGetValues("Retry-After", out var values);