summaryrefslogtreecommitdiff
path: root/foreign/parse/error_exception_handling.py
diff options
context:
space:
mode:
Diffstat (limited to 'foreign/parse/error_exception_handling.py')
-rw-r--r--foreign/parse/error_exception_handling.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/foreign/parse/error_exception_handling.py b/foreign/parse/error_exception_handling.py
new file mode 100644
index 0000000..27080a9
--- /dev/null
+++ b/foreign/parse/error_exception_handling.py
@@ -0,0 +1,11 @@
+from binary.data_handling.send_data import *
+from foreign.global_state import *
+
+
+def error_exception_handling(func):
+ def func_wrapper(conn, data):
+ try:
+ func(conn, data)
+ except Exception as err:
+ send_data(conn, {'message': f'Error: {err}\nPlease validate your input & try again', 'text_mode': 'danger'}, (state['settings']['encryption'], state['settings']['encoding'], state['settings']['headersize']))
+ return func_wrapper \ No newline at end of file