From 549c58088a9ea6331709fb9c922fbba3d53c624b Mon Sep 17 00:00:00 2001 From: Mohab Usama Date: Tue, 9 Apr 2019 15:59:36 +0200 Subject: [PATCH] Add default Exceptions/Errors #354 --- zmon_worker_monitor/zmon_worker/tasks/main.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/zmon_worker_monitor/zmon_worker/tasks/main.py b/zmon_worker_monitor/zmon_worker/tasks/main.py index 5d0304b0..315dfd86 100755 --- a/zmon_worker_monitor/zmon_worker/tasks/main.py +++ b/zmon_worker_monitor/zmon_worker/tasks/main.py @@ -695,12 +695,15 @@ def build_default_context(): 'abs': abs, 'all': all, 'any': any, + 'AttributeError': AttributeError, 'avg': avg, 'basestring': str, 'bin': bin, 'bool': bool, 'chain': itertools.chain, 'chr': chr, + 'ConnectionError': requests.ConnectionError, + 'ConnectTimeout': requests.ConnectTimeout, 'Counter': Counter, 'dict': dict, 'divmod': divmod, @@ -714,11 +717,14 @@ def build_default_context(): 'float': float, 'groupby': itertools.groupby, 'hex': hex, + 'HTTPError': requests.HTTPError, + 'IndexError': IndexError, 'int': int, 'isinstance': isinstance, 'json': json.loads, 'jsonpath_flat_filter': jsonpath_flat_filter, 'jsonpath_parse': jsonpath_rw.parse, + 'KeyError': KeyError, 'len': len, 'list': list, 'long': int, @@ -727,6 +733,7 @@ def build_default_context(): 'max': max, 'median': mathfun.median, 'min': min, + 'NameError': NameError, 'normalvariate': random.normalvariate, 'oct': oct, 'ord': ord, @@ -738,6 +745,7 @@ def build_default_context(): 'reduce': functools.reduce, 'reversed': reversed, 'round': round, + 'RuntimeError': RuntimeError, 'set': set, 'sorted': sorted, 'str': str, @@ -749,7 +757,9 @@ def build_default_context(): 'unichr': chr, 'unicode': str, 'urlparse': urlparse, + 'ValueError': ValueError, 'xrange': range, + 'ZeroDivisionError': ZeroDivisionError, 'zip': zip, }