makeplane / makeplane/plane

[bug]: dispatch() returns exception object instead of HTTP response on error

Open
#8,932 0 comments 0 reactions 0 assignees View on GitHub

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.pyBaseViewSet, BaseAPIView
  • apps/api/plane/api/views/base.pyBaseAPIView
  • apps/api/plane/license/api/views/base.pyBaseAPIView
  • apps/api/plane/space/views/base.pyBaseViewSet, BaseAPIView
Steps to reproduce
  1. 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)
  2. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.