-
Notifications
You must be signed in to change notification settings - Fork 59
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
Override error message in compute init #204
Conversation
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.
One requested change, but approved still.
@@ -355,6 +355,12 @@ func (c *InitCommand) Exec(in io.Reader, out io.Writer) (err error) { | |||
Comment: description, | |||
}) | |||
if err != nil { | |||
if strings.Contains(err.Error(), "Valid values for 'type' are: 'vcl'") { |
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.
Using strings.Contains
for checking an error always make me a little nervous due to its brittle nature. Sadly I'm not sure if there's a way around this. I just wanted to vocalise that this might be a problem that resurfaces if the backend API ever changes the text content.
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.
Yep, this is not great – we would want an error code to match on in an ideal world. For now this will have to do though, unless anyone has any suggestions.
57d03e8
to
e76eb45
Compare
Co-authored-by: Mark McDonnell <Integralist@users.noreply.github.com>
e76eb45
to
eb63cba
Compare
As reported by @ezambrano-fastly, users without the C@E feature flag enabled currently see a relatively cryptic message: "Unable to create service: valid values for 'type' are: 'vcl'"