<div dir="ltr">Hi,<br>
<br>
While working on unification of clients code we try to unify various exceptions in different client projects.<br>
We have module apiclient.exceptions in oslo-incubator[1]. Since our
apiclient is an oslo-inclubator library and not a standalone lib this
doesn't help in case we need to process exceptions from several clients.<br>
<br>
Please, look at horizon module exceptions:<br>
<a href="https://github.com/openstack/horizon/blob/master/openstack_dashboard/exceptions.py" target="_blank">https://github.com/openstack/horizon/blob/master/openstack_dashboard/exceptions.py</a> <br>
>From interpreter point of view apiclient exceptions will be different classes since they are copy-pasted between projects.<br>
<br>
The solution would be to use exceptions from external library - Module
WebOb.exc[2] for example (since WebOb is already used in other openstack
projects). This exceptions cover all our custom http exceptions.<br>
<br>
We propose to move to webob.exc in three stages(I already have patches
for this in oslo-incubator and I've added link here as an example):<br>
1) In clients: create aliases in module `exceptions` for all http
exceptions which are duplicated with webob.exc. This will help us safely
move to webob.exc without breaking tempest, horizon and other projects.
Usage of such exceptions will not cause significant changes. - <a href="https://review.openstack.org/#/c/71916/" target="_blank">https://review.openstack.org/#/c/71916/</a><br>
2) In all projects: importing exceptions and use them directly from webob.exc - <a href="https://review.openstack.org/#/c/76198/" target="_blank">https://review.openstack.org/#/c/76198/</a><br>
3) In clients: remove aliases for webob.exc. (at the end of backwards compatibility period)<br>
<br>
Please share your thoughts about this topic.<br>
<br>
[1] - <a href="https://github.com/openstack/oslo-incubator/blob/master/openstack/common/apiclient/exceptions.py" target="_blank">https://github.com/openstack/oslo-incubator/blob/master/openstack/common/apiclient/exceptions.py</a> <br>
[2] - <a href="http://turbogears.org/2.0/docs/modules/thirdparty/webob.html#module-webob.exc" target="_blank">http://turbogears.org/2.0/docs/modules/thirdparty/webob.html#module-webob.exc</a><div class=""><div id=":44" class="" tabindex="0">
<img class="" src="https://mail.google.com/mail/u/0/images/cleardot.gif"></div></div><span class=""><font color="#888888"></font></span><br>-- <br><div dir="ltr">
<style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<p style="margin:0px;text-indent:0px">Looking forward for your reply,</p>Andrey Kurilin.<br></div>
</div>