API: set the status code on errors

remotes/1693176582716663532/tmp_refs/heads/watchparty
justcool393 2022-10-12 01:17:48 -07:00
parent db0fd8a0e9
commit eaf361ad91
1 changed files with 1 additions and 1 deletions

View File

@ -30,7 +30,7 @@ def error(e):
if WERKZEUG_ERROR_DESCRIPTIONS.get(e.code, None) == details:
details = None
if request.headers.get("Authorization") or request.headers.get("xhr"):
return {"error": title, "code": e.code, "description": msg, "details": details}
return {"error": title, "code": e.code, "description": msg, "details": details}, e.code
img = ERROR_MARSEYS.get(e.code, 'marseyl')
return render_template('errors/error.html', err=True, title=title, msg=msg, details=details, img=img), e.code