From d42a428d66cc6b4769bb0531861bf8540599f653 Mon Sep 17 00:00:00 2001 From: Adhoniran Gomes <13842906+adhoniran@users.noreply.github.com> Date: Tue, 3 Oct 2023 12:23:54 -0300 Subject: [PATCH] Improved error message Improved error handling in the get_feed() method to provide a more descriptive error message when NetBox is unable to connect to the feed server. Instead of returning the original exception, we now return a custom error message for better clarity and security. --- netbox/extras/dashboard/widgets.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/netbox/extras/dashboard/widgets.py b/netbox/extras/dashboard/widgets.py index 9a8161924..1929141ed 100644 --- a/netbox/extras/dashboard/widgets.py +++ b/netbox/extras/dashboard/widgets.py @@ -319,8 +319,9 @@ class RSSFeedWidget(DashboardWidget): ) response.raise_for_status() except requests.exceptions.RequestException as e: + feed_error = 'NetBox is unable to connect to feed server...' return { - 'error': 'NetBox is unable to connect to feed server...', + 'error': feed_error, } # Parse feed content