Catch Runtime error when calling get_data_from_request (Flask)