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.
This commit is contained in:
Adhoniran Gomes 2023-10-03 12:23:54 -03:00
parent 17474b0033
commit d42a428d66

View File

@ -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