We had a number of places where we were catching a STATError just to see if it was due to a 404 and re-raising it if it wasn't. The definition of a new STATNotFound exception which is thrown by the rest (get/post/put) functions makes this handling easier.
As STATNotFound is defined as a child of STATError, the old way will still work so if I missed updating one of the cases where we were checking for 404 it will still continue be caught by a STATError handler.
Old Method
except STATError as e:
if e.source_error['status_code'] == 404:
pass
else:
raise STATError(e.error, e.source_error, e.status_code)
We had a number of places where we were catching a STATError just to see if it was due to a 404 and re-raising it if it wasn't. The definition of a new STATNotFound exception which is thrown by the rest (get/post/put) functions makes this handling easier.
As STATNotFound is defined as a child of STATError, the old way will still work so if I missed updating one of the cases where we were checking for 404 it will still continue be caught by a STATError handler.
Old Method
New Method