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):
resource_uid=self.getUid())
try:
return query[0].quantity
except:
raise LookupError('Can not find the Quantity Unit Conversion '\
'Definition. Please make sure that Unit '\
'Conversion Definitions are indexed.'\
'quantity_unit_uid: %s, resource_uid: %s' \
% (quantity_unit_uid, self.getUid()))
except IndexError:
raise IndexError('Can not find the Quantity Unit Conversion '\
'Definition. Please make sure that Unit '\
'Conversion Definitions are indexed and validated. '\
'quantity_unit_uid: %s, resource_uid: %s' \
% (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