I would like to catch 500 exception and return a http 4XX exception instead. Using "except Exception" will catch all exceptions which is not desired. I was wondering is there a way to catch only 500 errors
try:
<code>
except <Exception class>:
return http 404 reponse
I searched a lot but couldn't figure out how to do the same. Thanks in advance