In my Python API made with flask restplus and a swagger, there are many code layers (endpoints -> services -> facades -> providers) and each of them raises their own error codes (400, 404, 500 etc.). Since there are a lot of methods with specific errors, is there a way to know automatically, given a method, which are ALL the error codes that that method and the methods call by it can return? I feel that doing this by hand is neither a robust approach nor an efficient practice.
Asked
Active
Viewed 28 times
0
-
1Flask has the error_handlers function. Did you read the [documentation](http://flask.pocoo.org/docs/0.12/patterns/errorpages/) – Raja Simon May 30 '17 at 07:10
-
Yeah, I did. But if a function F calls functions A,B,C,D,E, (and for each of them an error_handeler is defined) is there a way for F to have the full list of error codes raised by the funcions it calls? – user1403546 May 30 '17 at 07:35
-
Sorry I wasn't clear: I want to catalog not the python code exceptions which are of course raised when they happen, but the error listed into the error_handlers. That is: I'd like F to have the total set of errors handled in A,B,C,D,E. – user1403546 May 30 '17 at 13:03