rescue exceptions and print appropriate status code