You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey 👋🏻 I'm not entirely sure why jobCancelError and jobSnoozeError are not exported as part of the public API, especially because jobCancelError also implements errors.Is and errors.Unwrap.
What I'm trying to achieve is to wrap my actual Work functions with an instrumented Work helper that logs/traces job errors. Right now the only way to check if the actual Work returned river.JobCancel or river.JobSnooze is to do a string prefix match, which isn't ideal.
Hey 👋🏻 I'm not entirely sure why
jobCancelError
andjobSnoozeError
are not exported as part of the public API, especially becausejobCancelError
also implementserrors.Is
anderrors.Unwrap
.What I'm trying to achieve is to wrap my actual
Work
functions with an instrumentedWork
helper that logs/traces job errors. Right now the only way to check if the actualWork
returnedriver.JobCancel
orriver.JobSnooze
is to do a string prefix match, which isn't ideal.For example:
If the error types were made public, I will be able to simplify this using
errors.Is(err, &river.JobCancelError{})
.The text was updated successfully, but these errors were encountered: