[PR #11621] [MERGED] Closes #11152: Add support to abort custom script gracefully #13816

Closed
opened 2025-12-29 23:20:58 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/11621
Author: @BarbarossaTM
Created: 1/31/2023
Status: Merged
Merged: 2/2/2023
Merged by: @jeremystretch

Base: developHead: 11152-report-script-errors


📝 Commits (1)

  • 3c92787 Closes #11152: Add support to abort custom script gracefully

📊 Changes

3 files changed (+29 additions, -1 deletions)

View changed files

📝 docs/customization/custom-scripts.md (+13 -0)
📝 netbox/extras/scripts.py (+9 -1)
📝 netbox/utilities/exceptions.py (+7 -0)

📄 Description

Fixes: #11152

This PR adds a new AbortScript exception which a custom script can throw in case the script should be terminated cleanly. It allows specifying an error message which will be reported to the user, but no stack trace is shown. Any other unhandled exception will still raise a stacktrace.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/11621 **Author:** [@BarbarossaTM](https://github.com/BarbarossaTM) **Created:** 1/31/2023 **Status:** ✅ Merged **Merged:** 2/2/2023 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `11152-report-script-errors` --- ### 📝 Commits (1) - [`3c92787`](https://github.com/netbox-community/netbox/commit/3c92787cafde6f36bb3e376d938b3d4a6cc1fbf6) Closes #11152: Add support to abort custom script gracefully ### 📊 Changes **3 files changed** (+29 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `docs/customization/custom-scripts.md` (+13 -0) 📝 `netbox/extras/scripts.py` (+9 -1) 📝 `netbox/utilities/exceptions.py` (+7 -0) </details> ### 📄 Description ### Fixes: #11152 This PR adds a new `AbortScript` exception which a custom script can throw in case the script should be terminated cleanly. It allows specifying an error message which will be reported to the user, but no stack trace is shown. Any other unhandled exception will still raise a stacktrace. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 23:20:58 +01:00
adam closed this issue 2025-12-29 23:20:58 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#13816