capture the status code before trying execution of the handler