-
Notifications
You must be signed in to change notification settings - Fork 25
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
Surface nova errors message for bad request responses (400) #160
Conversation
gophercloud at the moment just returns a generic “bad request” error message when nova returns a status 400 response for a server create request. But the response actually contains a detailed error message as to why the payload wasn’t accepted. (e.g. given image/flavor/key not found etc.) There is a 1 year old upstream PR solving the same thing but unfortuantely its going nowhere: gophercloud/gophercloud#303
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If i understand properly, this tries to turn the serialised json into a proper struct. I suppose this can't be generalised to do this always for all errors?
Would be cool to have this for all these Quota errors.
Otherwise LGTM.
} | ||
|
||
func (ce createError) Error() string { | ||
return "Failed to create server. This should not never be printed." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not never == always?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The deserialisation has to be defined for each error code. If quota errors result in a 400 bad request its already covered. If quota errors return something different we need to implement an additional interface for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ups. You got me. this doesn't make sense. one negation to much.
So it seems quota errors are returned as I opened an issue at gophercloud to get some feedback: gophercloud/gophercloud#713 |
gophercloud at the moment just returns a generic “bad request” error message when nova returns a status 400 response for a server create request.
But the response actually contains a detailed error message as to why the payload wasn’t accepted. (e.g. given image/flavor/key not found etc.)
There is a 1 year old upstream PR solving the same thing but unfortuantely its going nowhere: gophercloud/gophercloud#303