Can't specify error codes
armisael opened this issue · comments
Stefano Parmesan commented
I'd like to be able to specify the status code of the response, something like:
try:
something_nasty()
except:
return {
'some-info': 'here',
'some-other': here',
}, 418
Davide Setti commented
Nice idea! BTW ATM you can return a JsonResponse:
return JsonResponse({
'status': 'error',
'error': response.content,
},
status=status_code
)