PostHog / PostHog/drf-exceptions-hog

Force Multiple Exceptions Format

Open
#32 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
67
Forks
14
PR merge metrics
No merged PRs in 30d

Description

It would be useful to have only one error response format regardless of the number of errors as documenting and consuming both is a bit tedious.

So instead of:

if api_settings.SUPPORT_MULTIPLE_EXCEPTIONS and len(exception_list) > 1:
    create multiple format

Maybe something like?

if api_settings.FORCE_MULTIPLE_EXCEPTIONS or api_settings.SUPPORT_MULTIPLE_EXCEPTIONS and len(exception_list) > 1
    create multiple format

I can make a PR if you're interested.

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

Start by locating SUPPORT_MULTIPLE_EXCEPTIONS and the exception-response formatting logic in the repository. Trace how exception_list length selects the response shape, then check the existing tests around error responses. Done means the new setting consistently produces the multiple-exception format regardless of the number of errors, without changing the current default behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
django, python
Domain
api, backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.