#580: errorlib: migrate old ERR logging style to exception logging
-----------------------+----------------------
Reporter: simko | Owner: rajimene
Type: defect | Status: in_merge
Priority: major | Milestone:
Component: MiscUtil | Version:
Resolution: | Keywords:
-----------------------+----------------------
Comment (by Raquel Jimenez Encinar <raquel.jimenez.encinar@…>):
In [45415b4c87910864a3434de7090995eaccc171f2]:
{{{
#!CommitTicketReference repository=""
revision="45415b4c87910864a3434de7090995eaccc171f2"
BibFormat: migrate to exception logging
* Migrates error logging to new exception-based technique. (addresses
#580)
* Creates classes InvenioBibFormatError, InvenioBibFormatWarning,
InvenioBibFormatBfxError and InvenioBibFormatBfxWarning .
* Deletes calls to 'get_msgs_for_code_list' and 'register_errors',
and add code for these situations.
* Deletes CFG_BIBFORMAT_ERROR_MESSAGES, CFG_BIBFORMAT_WARNING_MESSAGES,
CFG_BIBFORMAT_BFX_ERROR_MESSAGES, CFG_BIBFORMAT_BFX_WARNING_MESSAGES
vars.
* Deletes 'errors' and warnings vars whenever it is needed.
* Modifies error message for error called
'ERR_BIBFORMAT_CANNOT_READ_TEMPLATE_FILE':
'Could not read format template named'
* Uses function 'string.find(error message)' in the cases where is checked
the error code.
* Updates comments of functions.
* Uses python module 'logging' instead of 'print' statements.
* Includes 'req' parameter in calls to 'register_exception' whenever
it is available.
* Adds calls to 'gettext_set_language' to translate the exception
messages.
* Changes the return value for function 'eval_format_element':
(value, []) to (value, dummy)
* In calls to function 'format_with_format_template' remove the access by
tuple because of this function does not return a tuple now.
* The same in 'bibformat_engine_tests.py ->
test_format_with_format_template,
removes access by tuple and removes the line code to check if the result
is a tuple because now is returned just one element.
}}}
--
Ticket URL: </ticket/580#comment:9>
Invenio <http://invenio-software.org>