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
systemd: provide more detailed errors for unimplemented method in emulation mode #11150
systemd: provide more detailed errors for unimplemented method in emulation mode #11150
Conversation
Codecov Report
@@ Coverage Diff @@
## master #11150 +/- ##
==========================================
- Coverage 78.25% 78.24% -0.01%
==========================================
Files 917 917
Lines 104205 104207 +2
==========================================
- Hits 81546 81538 -8
- Misses 17553 17561 +8
- Partials 5106 5108 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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.
Thanks, this looks very useful. One naming bikeshed/nitpick.
systemd/emulation.go
Outdated
@@ -39,18 +38,24 @@ type emulation struct { | |||
rootDir string | |||
} | |||
|
|||
var errNotImplemented = errors.New("not implemented in emulation mode") | |||
type errNotImplemented struct { |
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.
(nitpick) I would now call it notImplementedError
, the pattern in go seems to be that the [eE]rrXXXX
prefix is used for simple errors like ErrWriteToConnected = errors.New(...)
and the xxxxError
postfix when there are error structs. I vaguely remember that this was also written down somewhere but I can't find it anymore.
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.
Done.
8d91598
to
347dcd4
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.
LGTM, there's just one tiny typo
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.
LGTM!
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.
\o/
Provide more details with
notImplementedError
error to make it easier to understand what goes wrong.