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
For v3, we should add a library that allows the library users to intercept internal errors (especially ones that are automatically handled). This will allow the user to intercept and halt instances that might try to recover itself from unrecoverable situations, such as when a token is invalidated.
In this API, the NotifiedFunc function will be called on every internal error. If the function returns false in the chain, then the whole operation must be stopped and cleaned up. This is because by returning false, the user is suggesting that the error indicates an unrecoverable state.
Ideally, the library can handle this internally, but adding handlers for every single edge case is not completely feasible, so flexibility should be preferred.
As a sidenote, the API would be a lot more reasonable if Open() is blocking, since it would allow the user to handle unexpected cases without needing to rely on weird callbacks that are potentially racy; I can make a separate issue for this if there's not a good use case for a non-blocking Open().
The text was updated successfully, but these errors were encountered:
For v3, we should add a library that allows the library users to intercept internal errors (especially ones that are automatically handled). This will allow the user to intercept and halt instances that might try to recover itself from unrecoverable situations, such as when a token is invalidated.
The basic API of this library is listed below:
In this API, the
NotifiedFunc
function will be called on every internal error. If the function returnsfalse
in the chain, then the whole operation must be stopped and cleaned up. This is because by returningfalse
, the user is suggesting that the error indicates an unrecoverable state.Ideally, the library can handle this internally, but adding handlers for every single edge case is not completely feasible, so flexibility should be preferred.
As a sidenote, the API would be a lot more reasonable if
Open()
is blocking, since it would allow the user to handle unexpected cases without needing to rely on weird callbacks that are potentially racy; I can make a separate issue for this if there's not a good use case for a non-blockingOpen()
.The text was updated successfully, but these errors were encountered: