Skip to content

Uncaught Exceptions from within ModelViewSet are returned as HTML #7109

@thatmattlove

Description

@thatmattlove

NetBox version

v3.0.0

Python version

3.8

Steps to Reproduce

This can be tricky - something needs to done to trigger an uncaught exception from within ModelViewSet. I suppose you could add this...

raise Exception('test')

...here, and then make an API request.

Expected Behavior

At a minimum, I think we should append useful information to the error. Ideally, however, no HTML would be returned to an API client.

Observed Behavior

The returned value is something along the lines of:

{
  "error": "<giant unreadable HTML string>"
}

Metadata

Metadata

Assignees

Labels

status: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions