Server: Better error handling and provide error details
This commit is contained in:
@@ -105,7 +105,7 @@ class MapboxIsolines():
|
||||
elif response.status_code == requests.codes.unprocessable_entity:
|
||||
return []
|
||||
else:
|
||||
raise ServiceException(response.status_code, response)
|
||||
raise ServiceException('Unexpected response (' + str(response.status_code) + '): ' + str(response.content), response)
|
||||
except requests.Timeout as te:
|
||||
# In case of timeout we want to stop the job because the server
|
||||
# could be down
|
||||
|
||||
@@ -94,7 +94,7 @@ class MapboxRouting(Traceable):
|
||||
elif response.status_code == requests.codes.unprocessable_entity:
|
||||
return MapboxRoutingResponse(None, None, None)
|
||||
else:
|
||||
raise ServiceException(response.status_code, response)
|
||||
raise ServiceException('Unexpected response (' + str(response.status_code) + '): ' + str(response.content), response)
|
||||
except requests.Timeout as te:
|
||||
# In case of timeout we want to stop the job because the server
|
||||
# could be down
|
||||
|
||||
@@ -82,7 +82,7 @@ class TomTomIsolines():
|
||||
elif response.status_code == requests.codes.unprocessable_entity:
|
||||
return []
|
||||
else:
|
||||
raise ServiceException(response.status_code, response)
|
||||
raise ServiceException('Unexpected response (' + str(response.status_code) + '): ' + str(response.content), response)
|
||||
except requests.Timeout as te:
|
||||
# In case of timeout we want to stop the job because the server
|
||||
# could be down
|
||||
|
||||
@@ -120,7 +120,7 @@ class TomTomRouting(Traceable):
|
||||
elif response.status_code == requests.codes.unprocessable_entity:
|
||||
return TomTomRoutingResponse(None, None, None)
|
||||
else:
|
||||
raise ServiceException(response.status_code, response)
|
||||
raise ServiceException('Unexpected response (' + str(response.status_code) + '): ' + str(response.content), response)
|
||||
except requests.Timeout as te:
|
||||
# In case of timeout we want to stop the job because the server
|
||||
# could be down
|
||||
|
||||
Reference in New Issue
Block a user