Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion fastapi/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,9 @@ class FastAPIError(RuntimeError):


class ValidationException(Exception):
def __init__(self, errors: Sequence[Any]) -> None:
def __init__(self, errors: Sequence[Any], mistakes: Sequence[Any]) -> None:
self._errors = errors
self._mistakes = mistakes
Comment on lines +150 to +152
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Error 🐛 Bug

Constructor signature of ValidationException requires both 'errors' and 'mistakes'.

Issue Explanation
  • ValidationException.__init__ signature now requires two positional parameters: errors and mistakes.
  • mistakes has no default value, so omitting it triggers a TypeError.
  • Existing instantiations like ValidationException(errors) now fail at runtime.
  • File: blarApp/fastapi/fastapi/exceptions.py
def __init__(self, errors: Sequence[Any], mistakes: Sequence[Any]) -> None:
    self._errors = errors
    self._mistakes = mistakes

Reply if you have any questions or let me know if I missed something.

Don't forget to react with a 👍 or 👎 to the comments made by Blar to help us improve.


def errors(self) -> Sequence[Any]:
return self._errors
Expand Down
Loading