-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API: Modify error and log responses in webserver rest API #443
Labels
Comments
details = [
{
"loc": ".".join(map(str, e["loc"])),
"msg": e["msg"],
"type": e["type"],
}
for e in err.errors()
]
resp_payload= {
"error": {
"msg": reason_msg,
"resource": f"{resource}", # optional
"details": details, # optional
}
} |
class OneError(BaseModel):
msg: str
type_: str | None = Field(None, alias="type")
loc: str | None = None
class ManyErrors(BaseModel):
msg: str
details: list[OneError] = [] |
1 task
Current error model
Most of the time it will be
or simply (i.e. w/o data)
When the backend has an OEC it will be added as an supportId tag that the front end could present hidden as in
|
Odei would find it useful on the frontend if the 402 Payment Required error is raised also included additional fields, such as the current amount of credits in the wallet. For example:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Simplify by removing logger and adding a single message
The text was updated successfully, but these errors were encountered: