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
Using NSQ as a library, including lookupd, is a little tricky to handle error situations, like if you have something else on the same port. It doesn't expose the error beyond a log, and then it calls os.Exit, so importers have no chance to handle the error themselves and it brings down the rest of the program. (This caused a problem for me in test code, where I typically need defers to run to do some cleanup. :) )
I'm proposing a new top-level function that will perform most of what Main does now, but has a new name and returns errors instead of logging and exiting. That function could be named MainErr. Main, then, will call MainErr and then use the return value to recreate its current behavior.
The text was updated successfully, but these errors were encountered:
Using NSQ as a library, including lookupd, is a little tricky to handle error situations, like if you have something else on the same port. It doesn't expose the error beyond a log, and then it calls os.Exit, so importers have no chance to handle the error themselves and it brings down the rest of the program. (This caused a problem for me in test code, where I typically need
defer
s to run to do some cleanup. :) )I'm proposing a new top-level function that will perform most of what
Main
does now, but has a new name and returns errors instead of logging and exiting. That function could be namedMainErr
.Main
, then, will callMainErr
and then use the return value to recreate its current behavior.The text was updated successfully, but these errors were encountered: