Skip to content

Commit

Permalink
add plugins actions traceback
Browse files Browse the repository at this point in the history
  • Loading branch information
syrk4web committed Apr 15, 2024
1 parent 664860d commit 45267c0
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 4 deletions.
5 changes: 4 additions & 1 deletion clamav/ui/actions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from traceback import format_exc

def pre_render(**kwargs):
pass

Expand All @@ -17,7 +19,8 @@ def clamav(**kwargs):
try:
ping_data = kwargs["app"].config["INSTANCES"].get_ping("clamav")
ping = {"ping_status": ping_data["status"]}
except:
except BaseException:
print(f"Error while trying to ping clamav : {format_exc()}", flush=True)
ping = {"ping_status": "error"}

return {**ping}
5 changes: 4 additions & 1 deletion coraza/ui/actions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from traceback import format_exc

def pre_render(**kwargs):
pass

Expand All @@ -17,7 +19,8 @@ def coraza(**kwargs):
try:
ping_data = kwargs["app"].config["INSTANCES"].get_ping("coraza")
ping = {"ping_status": ping_data["status"]}
except:
except BaseException:
print(f"Error while trying to ping coraza : {format_exc()}", flush=True)
ping = {"ping_status": "error"}

return {**ping}
5 changes: 4 additions & 1 deletion crowdsec/ui/actions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from traceback import format_exc

def pre_render(**kwargs):
pass

Expand All @@ -17,7 +19,8 @@ def crowdsec(**kwargs):
try:
ping_data = kwargs["app"].config["INSTANCES"].get_ping("crowdsec")
ping = {"ping_status": ping_data["status"]}
except:
except BaseException:
print(f"Error while trying to ping crowdsec : {format_exc()}", flush=True)
ping = {"ping_status": "error"}

return {**ping}
5 changes: 4 additions & 1 deletion discord/ui/actions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from traceback import format_exc

def pre_render(**kwargs):
pass

Expand All @@ -17,7 +19,8 @@ def discord(**kwargs):
try:
ping_data = kwargs["app"].config["INSTANCES"].get_ping("discord")
ping = {"ping_status": ping_data["status"]}
except:
except BaseException:
print(f"Error while trying to ping discord : {format_exc()}", flush=True)
ping = {"ping_status": "error"}

return {**ping}
3 changes: 3 additions & 0 deletions slack/ui/actions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from traceback import format_exc

def pre_render(**kwargs):
pass

Expand All @@ -18,6 +20,7 @@ def slack(**kwargs):
ping_data = kwargs["app"].config["INSTANCES"].get_ping("slack")
ping = {"ping_status": ping_data["status"]}
except:
print(f"Error while trying to ping slac : {format_exc()}", flush=True)
ping = {"ping_status": "error"}

return {**ping}
3 changes: 3 additions & 0 deletions virustotal/ui/actions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from traceback import format_exc

def pre_render(**kwargs):
pass

Expand All @@ -18,6 +20,7 @@ def virustotal(**kwargs):
ping_data = kwargs["app"].config["INSTANCES"].get_ping("virustotal")
ping = {"ping_status": ping_data["status"]}
except:
print(f"Error while trying to ping virustotal : {format_exc()}", flush=True)
ping = {"ping_status": "error"}

return {**ping}
3 changes: 3 additions & 0 deletions webhook/ui/actions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from traceback import format_exc

def pre_render(**kwargs):
pass

Expand All @@ -18,6 +20,7 @@ def webhook(**kwargs):
ping_data = kwargs["app"].config["INSTANCES"].get_ping("webhook")
ping = {"ping_status": ping_data["status"]}
except:
print(f"Error while trying to ping webhook : {format_exc()}", flush=True)
ping = {"ping_status": "error"}

return {**ping}

0 comments on commit 45267c0

Please sign in to comment.