Comment 1 for bug 1193022

Revision history for this message
Evan (ev) wrote :

It will if you set settings.DEBUG = True, but we don't have that enabled in production. Tastypie does let you override the default error message (settings.TASTYPIE_CANNED_ERROR), but that's global.

I think the cleaner solution would be to override _handle_500 and checking to see if `exception` is an instance of NOT_FOUND_EXCEPTIONS (see tastypie/resources.py:277). If it isn't, call the parent _handle_500. If it is, return self.error_response(request, {'error_message': 'your error goes here'}, response_class=HttpResponseNotFound).