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
BackendException is used in several modules but it's raised for two different purpose in the backend connection process in client.py:
with code >1000 for errors in the first stage connection = Requests errors are reencoded
with specific HTTP errors codes when the connection to the backend is established, but the backend returns some specific errors (login error, bad url requested, hosts not found, ...).
The first stage errors (code>1000) are only used in the tests, while the others are only catches by module_backend for 404/422 http errors.
On the other hand, the response BackendException's parameter is never really used by the others modules except for logging, it's just used in webui and module_logs in returned results. Problem: this parameter is only filled by second stage errors, after a successful connection, else =None.
Proposed solutions:
Keep BackendException for first stage errors, and create a second Exception class for specific Backend errors in second stage responses. Pros: Clear separation in stages. Cons: several modules need to be rewritten.
Keep only one specific error for all first stage errors (1000 for example) and set the "message" BackendException's parameter to the returned Requests error message with a false generated response parameter, and continue to use the second stage errors as is. Pros: no need to rewrite modules, just tests. Cons: no separation in connection stages (but who care about it?)
The text was updated successfully, but these errors were encountered:
BackendException is used in several modules but it's raised for two different purpose in the backend connection process in client.py:
The first stage errors (code>1000) are only used in the tests, while the others are only catches by module_backend for 404/422 http errors.
On the other hand, the response BackendException's parameter is never really used by the others modules except for logging, it's just used in webui and module_logs in returned results. Problem: this parameter is only filled by second stage errors, after a successful connection, else =None.
Proposed solutions:
The text was updated successfully, but these errors were encountered: