summaryrefslogtreecommitdiff
path: root/foreign/parse/error_exception_handling.py
diff options
context:
space:
mode:
authorAL-LCL <alvin@alvinhavel.com>2023-05-19 11:01:49 +0200
committerAL-LCL <alvin@alvinhavel.com>2023-05-19 11:01:49 +0200
commit20dbeb2f38684c65ff0a4b99012c161295708e88 (patch)
treea5b8445f55da2fbbb92443b68e9d7354a290c598 /foreign/parse/error_exception_handling.py
NeoRATHEADmain
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