Commit a0ee2634 authored by Tatuya Kamada's avatar Tatuya Kamada

We should catch an exception explicitly.

See Coding Crime Guideline.  http://www.erp5.org/GuidelinesForCodingCrimes
(thx nicolas)
parent b6ea4f65
...@@ -1136,9 +1136,9 @@ class Resource(XMLObject, XMLMatrix, VariatedMixin): ...@@ -1136,9 +1136,9 @@ class Resource(XMLObject, XMLMatrix, VariatedMixin):
resource_uid=self.getUid()) resource_uid=self.getUid())
try: try:
return query[0].quantity return query[0].quantity
except: except IndexError:
raise LookupError('Can not find the Quantity Unit Conversion '\ raise IndexError('Can not find the Quantity Unit Conversion '\
'Definition. Please make sure that Unit '\ 'Definition. Please make sure that Unit '\
'Conversion Definitions are indexed.'\ 'Conversion Definitions are indexed and validated. '\
'quantity_unit_uid: %s, resource_uid: %s' \ 'quantity_unit_uid: %s, resource_uid: %s' \
% (quantity_unit_uid, self.getUid())) % (quantity_unit_uid, self.getUid()))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment