#41: search_engine.py is catching Exception all over the place
-----------------------+----------------------------------------------------
Reporter: jblayloc | Owner:
Type: defect | Status: new
Priority: minor | Milestone:
Component: WebSearch | Version: v0.99.1
Keywords: |
-----------------------+----------------------------------------------------
Comment(by simko):
Some observations:
Firstly, note that it is not "all over the place", but in the data
cacher parts only; there is no other usage. Moreover, `Exception' is
often thrown and then re-caught, meaning a data cacher has not been
initialized yet; one could introduce and use an Invenio native
exception for that.[*]
Secondly, there are not only Exception catching cases, there are also
'except:' cases, which are just as uncool, and more numerous. (Though
it may be sometimes handy, as in if anything went wrong during X, then
Y.)
Thirdly, other modules naturally suffer from this problem too:
{{{
bibcatalog 6
bibclassify 5
bibedit 8
bibexport 1
bibformat 5
bibharvest 5
bibindex 2
bibknowledge 2
bibrank 31
bibsched 7
bibupload 4
elmsubmit 3
miscutil 27
webaccess 4
webalert 18
webbasket 26
webcomment 7
webjournal 34
webmessage 1
websearch 47
websession 13
webstyle 30
websubmit 47
}}}
[*] Which is kind of partially related to the long-standing
infrastructure task of moving error handling from the old style
(ERR_WEBFOO_BAR values) to the new style (!InvenioWebFooBarError
exceptions).
--
Ticket URL: <http://cdswaredev.cern.ch/invenio/ticket/41#comment:1>
Invenio <http://cdswaredev.cern.ch/invenio>