You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the current code, each mutation requires manually injecting ok and msg in the form of cls(ok="...", msg="...") every time.
This approach is prone to mistakes, and since it involves code related to the API interface, mistakes can be difficult to roll back.
We can refactor it to simply throw an error when an error occurs, allowing the middleware to handle it instead.
It seems this middleware could be added at the following location.
The text was updated successfully, but these errors were encountered:
jopemachine
changed the title
Implementation of Exception Handling in Graphene Middleware
Implementat Exception Handling in Graphene Middleware
Dec 6, 2024
jopemachine
changed the title
Implementat Exception Handling in Graphene Middleware
Implement Exception Handling by Graphene Middleware
Dec 6, 2024
Main idea
In the current code, each mutation requires manually injecting
ok
andmsg
in the form ofcls(ok="...", msg="...")
every time.This approach is prone to mistakes, and since it involves code related to the API interface, mistakes can be difficult to roll back.
We can refactor it to simply throw an error when an error occurs, allowing the middleware to handle it instead.
It seems this middleware could be added at the following location.
backend.ai/src/ai/backend/manager/api/admin.py
Lines 97 to 101 in eadddf6
The text was updated successfully, but these errors were encountered: