-
Notifications
You must be signed in to change notification settings - Fork 48
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
HCP: error handling & empty source image id #90
Conversation
if img == nil { | ||
return errors.New("no go on empty image") | ||
} |
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.
I think this was added to avoid a panic in case FromMappedData
failed and returned a nil image. In this case, I think that this should panic, since the error was not checked. Also, this error is kind of weird.
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.
(ditto throughout)
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.
(I'm also super open to suggestions!)
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 error is weird but panicking too. Maybe improving the error message is better 🤔 what do you think? Making it a friendly panic 😆
07ddb72
to
52e55e7
Compare
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.
In a 1:1 zoom with @nywilken, we are going to merge this one.
It is okay if SourceImageID is not set, and we can revisit that when we work on ancestry.
It's okay to panic when img is nil after an instantiation call failed.
No description provided.