-
Notifications
You must be signed in to change notification settings - Fork 15
Closed
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
For now, the MLFlowClient.jl simply throw out HTTP.Exceptions.StatusError
or use hard code error message, and this is hard to figuar out what is wrong.
I found that for any 4xx and 5xx JSON response, it will give a error message:
{
"error_code": "RESOURCE_DOES_NOT_EXIST",
"message": "Could not find experiment with ID 0004"
}
So, why not parse and throw this error message , rather than manually hard code error message like:
catch e
if isa(e, HTTP.ExceptionRequest.StatusError) && e.status == 400
error_code = JSON.parse(String(e.response.body))["error_code"]
# if error_code == MLFLOW_ERROR_CODES.RESOURCE_ALREADY_EXISTS
# error("Experiment with name \"$name\" already exists")
#end
error_message = JSON.parse(String(e.response.body))["error_message"]
error(error_message)
end
throw(e)
end
We can add a unified error handler, if you think this is useful I can implement it and open a pull request!
Thanks!
ablaom and pebeto
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers