Skip to content

Commit

Permalink
improved error message on injection errors
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianLudwig committed May 22, 2015
1 parent 327781d commit 448ee23
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion rw/scope.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# under the License.
from __future__ import absolute_import, division, print_function, with_statement

import sys
import contextlib
import functools
import inspect
Expand Down Expand Up @@ -156,7 +157,13 @@ def wrapper(*args, **kwargs):
# the key might not be inside scope but there might be
# a default parameter defined inside the function
pass
return fn(*args, **kwargs)

try:
return fn(*args, **kwargs)
except:
msg = 'Error injecting into {}.{}'
print(msg.format(fn.__module__, fn.__name__), file=sys.stderr)
raise

return wrapper

Expand Down

0 comments on commit 448ee23

Please sign in to comment.