flask error_handler first stage