go-systemd icon indicating copy to clipboard operation
go-systemd copied to clipboard

Provide error handling for Reboot() call

Open invidian opened this issue 3 years ago • 4 comments

Right now user has no way of knowing if calling Reboot() succeeds or not, as no error is returned from a call. E.g. if user calling it has no permissions to do so, the call will silently fail.

This could be improved, e.g. together with accepting the context for operation in new function.

invidian avatar Jan 06 '22 13:01 invidian

Good idea, a RebootWithContext would fit nicely. Would you like to submit a PR with that?

lucab avatar Jan 06 '22 13:01 lucab

Can't promise I find time to do so, but will try :)

invidian avatar Jan 06 '22 14:01 invidian

Ah, just found out there is more general issue for this: #326, not sure if it make sense to address each method individually or should we handle all of them at once.

invidian avatar Jan 06 '22 14:01 invidian

Created #390 to address this.

invidian avatar Jan 10 '22 10:01 invidian