Closed mgmonteleone closed 1 year ago
Hmmm, in testing I do get back details...
Test:
def test_00_handle_400s(self):
"""
Force a 400 error so we can test details being passed through.
"""
cluster = self.a.Clusters.get_single_cluster(cluster=self.TEST_CLUSTER_NAME)
update = self.a.Clusters.modify_cluster(cluster=self.TEST_CLUSTER_NAME,cluster_config=dict(backupEnabled="whatevs"))
pprint(update)
Error_Handler: CRITICAL: A generic error was raised
Error_Handler: CRITICAL: {'detail': 'An invalid enumeration value whatevs was specified.', 'error': 400, 'errorCode': 'INVALID_ENUM_VALUE', 'parameters': ['whatevs'], 'reason': 'Bad Request'}
So this should show up in logs....
But perhaps should pass the details all the way up?
The getAtlasResponse
method of the error object will return the full error information from the API.
That said, I will go ahead and submit a PR to include more of the origin error information in the base error.
This needs to ensure that the full error message from the API is returned,
Otherwise it is very difficult to debug 400 errors.