In the v4 version you can return errors such as ErrDoNotRestart and ErrTerminateTree to determine further actions on the status of the service. It might be something a little bit stupid, but I did not know about 1.13 error features and so I spent a little bit figuring out the best way to return these errors without writing too much workaround code.
In the end, suture/v4 uses errors.Is() to check if an error matches a target error, such as ErrDoNotRestart. So it's not exactly needed to return, for example, ErrDoNotRestart, because as long as you wrap it inside your error the supervisor will recognize it as such.
In the v4 version you can return errors such as
ErrDoNotRestart
andErrTerminateTree
to determine further actions on the status of the service. It might be something a little bit stupid, but I did not know about 1.13 error features and so I spent a little bit figuring out the best way to return these errors without writing too much workaround code.In the end, suture/v4 uses
errors.Is()
to check if an error matches a target error, such asErrDoNotRestart
. So it's not exactly needed to return, for example,ErrDoNotRestart
, because as long as you wrap it inside your error the supervisor will recognize it as such.