Commit bde64fcbf154b7bdd70ffcd9b86b3476d11c3bfc
1 parent
6d7efff0
Raise AttributeError if attribute does not exist
Showing
1 changed file
with
2 additions
and
1 deletions
... | ... | @@ -241,7 +241,8 @@ def get_from_object(obj, attribute): |
241 | 241 | return_list = [i.value for i in jsonpath_expr.find(obj)] |
242 | 242 | if return_list: |
243 | 243 | return return_list[0] |
244 | - return None | |
244 | + else: | |
245 | + raise AttributeError('Attribute not found: {0}'.format(attribute)) | |
245 | 246 | |
246 | 247 | |
247 | 248 | def wait_to_date(date_stamp): | ... | ... |
Please
register
or
login
to post a comment