Document exception handling

Many new contributors print the errors returned by the API
directly to the UI. However, this is dangerous because errors
can be very technical/ reveal sensitive data/ and are not
translatable. We need to document this for reference.

Change-Id: Ic0ad138b69995d842af0eeeeab73fa3ebec795c9
Implements: bp document-exception-propogation
This commit is contained in:
Cindy Lu 2016-11-08 15:39:12 -08:00
parent 8c17f76e96
commit 55bd8901c4
1 changed files with 11 additions and 0 deletions

View File

@ -485,6 +485,17 @@ Again, readability is paramount; however be conscientious of how the browser
will handle whitespace when rendering the output. Two spaces is the preferred
indentation style to match all front-end code.
Exception Handling
------------------
Avoid propogating direct exception messages thrown by OpenStack APIs to the UI.
It is a precaution against giving obscure or possibly sensitive data to a user.
These error messages from the API are also not translatable. Until there is a
standard error handling framework implemented by the services which presents
clean and translated messages, horizon catches all the exceptions thrown by the
API and normalizes them in :func:`horizon.exceptions.handle`.
Documentation
-------------