Hide traceback in rendered config #10503

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

Originally created by @alehaa on GitHub (Nov 21, 2024).

Originally assigned to: @alehaa on GitHub.

NetBox version

v4.1.6

Feature type

Change to existing functionality

Triage priority

I volunteer to perform this work (if approved)

Proposed functionality

When a rendered configuration template raises an exception, the full traceback is included in the Rendered Config pane. I suggest limiting this to the exception type and message.

Use case

End users without a programming background might be confused by seeing the full traceback. Seeing only the error message may be more helpful to them for resolving the problem.

Database changes

None.

External dependencies

None.

Originally created by @alehaa on GitHub (Nov 21, 2024). Originally assigned to: @alehaa on GitHub. ### NetBox version v4.1.6 ### Feature type Change to existing functionality ### Triage priority I volunteer to perform this work (if approved) ### Proposed functionality When a rendered configuration template raises an exception, the full traceback is included in the Rendered Config pane. I suggest limiting this to the exception type and message. ### Use case End users without a programming background might be confused by seeing the full traceback. Seeing only the error message may be more helpful to them for resolving the problem. ### Database changes None. ### External dependencies None.
adam added the status: acceptedtype: featurecomplexity: low labels 2025-12-29 21:32:20 +01:00
adam closed this issue 2025-12-29 21:32:20 +01:00
Author
Owner

@bctiemann commented on GitHub (Nov 22, 2024):

Seems reasonable. It might be helpful if you could include a screenshot of the current behavior in the issue description so we can evaluate the before/after UX.

@bctiemann commented on GitHub (Nov 22, 2024): Seems reasonable. It might be helpful if you could include a screenshot of the current behavior in the issue description so we can evaluate the before/after UX.
Author
Owner

@sdktr commented on GitHub (Nov 22, 2024):

What if you actually want to see the full traceback to fix/better understand the issue?

@sdktr commented on GitHub (Nov 22, 2024): What if you actually want to see the full traceback to fix/better understand the issue?
Author
Owner

@alehaa commented on GitHub (Nov 30, 2024):

@sdktr As far as I know, the traceback doesn't contain any useful information for tracing problems inside the template. Instead, it contains the call stack of how the template is rendered. So I've created a PR to limit that information, as it's usually not helpful to non-dev users at all.

I see the benefit of adding information about where a template error occurs. However, as far as I know, only the TemplateSyntaxError exception provides additional information such as line numbers. If you have suggestions for tweaking the error message to make it more useful, feel free to comment my PR and I'll see if I can integrate it.

@alehaa commented on GitHub (Nov 30, 2024): @sdktr As far as I know, the traceback doesn't contain any useful information for tracing problems inside the template. Instead, it contains the call stack of **how** the template is rendered. So I've created a PR to limit that information, as it's usually not helpful to non-dev users at all. I see the benefit of adding information about where a template error occurs. However, as far as I know, only [the `TemplateSyntaxError` exception](https://config-ninja.readthedocs.io/en/latest/jinja2/exceptions.html#TemplateRuntimeError) provides additional information such as line numbers. If you have suggestions for tweaking the error message to make it more useful, feel free to comment my PR and I'll see if I can integrate it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10503