[bug]: dispatch() returns exception object instead of HTTP response on error
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 59.6k
- Forks
- 5.8k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 49
Description
Is there an existing issue for this?
- I have searched the existing issues
Current behavior
In all four base view files, the dispatch() method catches exceptions, calls self.handle_exception(exc) to build a proper HTTP response, and then returns the raw Python exception object (exc) instead of the response it just built.
except Exception as exc:
response = self.handle_exception(exc)
return exc # ← should be `return response`
The response variable is correctly built but then discarded. Django/DRF receives a bare exception object instead of an HttpResponse, so error responses from all inherited views are broken.
Affected files:
apps/api/plane/app/views/base.py—BaseViewSet,BaseAPIViewapps/api/plane/api/views/base.py—BaseAPIViewapps/api/plane/license/api/views/base.py—BaseAPIViewapps/api/plane/space/views/base.py—BaseViewSet,BaseAPIView
Steps to reproduce
- Hit any endpoint that triggers an exception (e.g. request a non-existent resource to get a 404, or send invalid data to get a 400)
- Observe that instead of a structured JSON error response, the framework receives a bare exception object
Environment
All environments
Browser
N/A (backend)
Variant
All
Version
All
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Inspect the dispatch() methods in the four listed base view files, covering BaseViewSet and BaseAPIView variants. Reproduce an exception response using the issue's 404 or 400 examples, then verify that each affected method returns the constructed HTTP response and that structured error responses are restored.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 84/100