Skip to content

Commit

Permalink
ApiError needs __str__() with pprint, albeit it is a dataclass :-(
Browse files Browse the repository at this point in the history
  • Loading branch information
jnussbaum committed Oct 13, 2023
1 parent d519ec9 commit 7e5782a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dsp_permissions_scripts/models/api_error.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import pprint
from dataclasses import dataclass, field
from typing import Any

Expand All @@ -10,3 +11,6 @@ class ApiError(Exception):
response_text: str | None = None
status_code: int | None = None
payload: dict[str, Any] = field(default_factory=dict)

def __str__(self) -> str:
return pprint.pformat(vars(self))

0 comments on commit 7e5782a

Please sign in to comment.