Report failures are amibigous #7577

Closed
opened 2025-12-29 20:25:37 +01:00 by adam · 3 comments
Owner

Originally created by @abhi1693 on GitHub (Jan 28, 2023).

NetBox version

v3.4.3

Feature type

Change to existing functionality

Proposed functionality

Add tracebacks to the logger when an exception is raised

Use case

I wrote a report with pre_run that raises exceptions when prerequisites are not met. The console only displayed Error during execution of report test.myreports.Report001. This does not provide any context of why the execution failed.

Database changes

No response

External dependencies

No response

Originally created by @abhi1693 on GitHub (Jan 28, 2023). ### NetBox version v3.4.3 ### Feature type Change to existing functionality ### Proposed functionality Add tracebacks to the logger when an exception is raised ### Use case I wrote a report with pre_run that raises exceptions when prerequisites are not met. The console only displayed `Error during execution of report test.myreports.Report001`. This does not provide any context of why the execution failed. ### Database changes _No response_ ### External dependencies _No response_
adam added the type: feature label 2025-12-29 20:25:37 +01:00
adam closed this issue 2025-12-29 20:25:38 +01:00
Author
Owner

@jsenecal commented on GitHub (Jan 31, 2023):

Hi @abhi1693 ,
Stack traces can often leak sensitive information. I would rather opt for the report developer to properly handle exceptions when writing them to begin with.
Let us know what you think.

@jsenecal commented on GitHub (Jan 31, 2023): Hi @abhi1693 , Stack traces can often leak sensitive information. I would rather opt for the report developer to properly handle exceptions when writing them to begin with. Let us know what you think.
Author
Owner

@abhi1693 commented on GitHub (Jan 31, 2023):

Then, can a better exception logger be added? Something like

try:
  ...
except Exception as e:
  logger.error(e)
@abhi1693 commented on GitHub (Jan 31, 2023): Then, can a better exception logger be added? Something like ``` try: ... except Exception as e: logger.error(e) ```
Author
Owner

@jeremystretch commented on GitHub (Mar 16, 2023):

I agree with @jsenecal that we should not decide on behalf of the script author how much detail is prudent to provide in the event of an error. The onus is on the author to handle errors that result from script execution, and IMO we have sufficient logging utilities in place. Happy to discuss further if anyone would like to propose a specific improvement in a new FR.

@jeremystretch commented on GitHub (Mar 16, 2023): I agree with @jsenecal that we should not decide on behalf of the script author how much detail is prudent to provide in the event of an error. The onus is on the author to handle errors that result from script execution, and IMO we have sufficient logging utilities in place. Happy to discuss further if anyone would like to propose a specific improvement in a new FR.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7577