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
This above should then attempt to shut down all previously started dependencies. If there's an error in a service's stop(), it will just have to be aborted and continue stopping other dependencies. After the full shutdown, either all errors or the first should be thrown, so as to notify the user what's happened
As far as I can tell there's no process for handling errors (especially asynchronous ones) at the moment
I can happily work on this myself or help out. Lemme know your thoughts
The text was updated successfully, but these errors were encountered:
Hey thanks for this - much appreciated. I'm going to give it some thought; I don't want to rush into anything just yet. I'm not sure I want to proscribe a particular way of handling errors, although you may be right and it may be as simple as propagating errors to the next() function.
Off the top of my head, my general thinking is that components are responsible for their own error handling; passing errors down the chain doesn't actually mean anything because you have no guarantee which component will be called next (and it's not ever something you can rely on; only that your dependencies will be started first). Instead it might be better to have the Lifecycle methods catch any exception and shut down any started components (or bail with prejudice if shutting them down is not an option), which I think is similar to what you're suggesting.
The
next()
function handed to calls toinit()
,start()
andstop()
should have an argument for indicating an error. So you can do something like:This above should then attempt to shut down all previously started dependencies. If there's an error in a service's
stop()
, it will just have to be aborted and continue stopping other dependencies. After the full shutdown, either all errors or the first should be thrown, so as to notify the user what's happenedAs far as I can tell there's no process for handling errors (especially asynchronous ones) at the moment
I can happily work on this myself or help out. Lemme know your thoughts
The text was updated successfully, but these errors were encountered: