[openstack-dev] [vitrage] error handling
Yujun Zhang (ZTE)
zhangyujun+zte at gmail.com
Mon May 29 13:13:43 UTC 2017
Brought up by a recent code review, I think it worth a thorough discussion
about the error handling rule.
I once read an article from Joyent and it impressed me on the
distinguish between *Operational* errors vs. *programmer* errors. The
article is written for nodejs, but the principle also applies for other
The basic rule recommended by Joyent is
Handling operational errors
(Not) handling programmer errors
There is also one rule in openstack style guide line close to this idea.
[H201] Do not write except:, use except Exception: at the very least. When
catching an exception you should be as specific so you don’t mistakenly
catch unexpected exceptions.
I do think before we have a well designed error handling, it is better to
let it crash. It is dangerous to hide the errors and keep the system
running in undetermined states.
So the question is *what kind of operational errors are we facing in
vitrage?* I can think of something like
1. invalid configuration file
2. failed to communicate with data source
3. malformed data from data source
4. failed to execute an action
Maybe this could be the first step for the error handling design.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the OpenStack-dev