Closed achimnol closed 2 years ago
Hmm, For the first time, I define UnknownImageReference exception
I have a question.
I watched Manager's Exception class codes.
It defines both error_type
and error_title
.
I have no about UnknownImageReference's error_type and error_title.
Is the URL of error_type already defined? @achimnol
I have a question. I watched Manager's Exception class codes. It defines both
error_type
anderror_title
. I have no about UnknownImageReference's error_type and error_title.Is the URL of error_type already defined? @achimnol
Our error response in the JSON format follows the RFC 7807 style. The URLs used in the error_type
field (e.g., https://api.backend.ai/probs/...
) is just an arbitrary identifier and not real URLs. In the client side, it is referred to implemented error-specific display of the additional data
field using suffix matches (e.g., .endswith('/invalid-api-params)
in the client SDK).
There is no "big hidden" reason to choose RFC 7807, but it's just to have a commonly referrable standard which describes the background on behalf of me.
For the first time, I think that add error_type on Manager, client-py and webserver.
Error type : /unknown-image-reference
Error title: Unknown Image Reference
Example of invalid-api-params
codes
invalid-api-params
code
https://github.com/lablup/backend.ai-manager/blob/4bcbb8eba5de0c71ef149fb485a3131aac09f1d3/src/ai/backend/manager/api/exceptions.py#L183-L185invalid-api-params
code
https://github.com/lablup/backend.ai-webserver/blob/1342df5ddd9b13927037385a0a57ee755f17b12f/src/ai/backend/web/server.py#L295-L304invalid-api-params
code
https://github.com/lablup/backend.ai-client-py/blob/94d9ba47cb59dfaf44ff5ce1354c790a74b26ddb/src/ai/backend/client/cli/pretty.py#L118-L127Ooops, I checked UnknownImageReference
from backend.ai's common repo.
UnknownImageReference
is already defined backend.ai-common repo https://github.com/lablup/backend.ai-common/blob/0c42db25eb6650265d5aed71ed5dc597445b6fac/src/ai/backend/common/exception.py#L13
So, I changed the manager exception definition.
UnknownImageReference
to UnknownImageReferenceError
Changed it to use ObjectNotFound
error introduced with #378.
It is already finished. So I close the issue.
Do what the title says in the manager's session creation routines, with sensible error messages.