Getting status codes when exceptions