-
-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log errors and exit on authentication issues on Hubot plugin initialization #168
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find the fact that we need introducing ENV variable like EXIT_ON_FAILURES
a bad sign.
It's an expected practice for an app to exit if there is a critical error we can't recover from.
Otherwise what value brings the daemon which prints single Failed to authenticate:
error message and going into a waiting behavior?
If we talk about the failure which could be potentially recovered by connection retries/or retries with backoff, - we can consider using that instead. But if nothing helped, - always exit with error message and non-zero exit code.
We have this behavior between other microservices of ST2, so it would be nice to have the same behavior in st2chatops. But code-wise, it would be frustrating to keep the semantics of "retry with backoff" in st2chatops up-to-date with how it works in the rest of ST2.
This is the easiest thing for us to do. At this point, I think this behavior is a good compromise between trying to behave like the other ST2 services and increased complexity of this codebase/PR. |
1f43a26
to
8f6dcad
Compare
Fixes StackStorm/st2chatops#124 For the case if st2chatops encounters authenticate or unresolved application URL issues with Stackstorm, instead it's being unresponsive/hanging/waiting in a running state, st2chatops will be exit.
8f6dcad
to
8f7c74e
Compare
New callback function to handle uncaught hubot exceptions. Add new generic function to handle exception and gracefully exit from process.
81ecd17
to
6165f1e
Compare
Log error inside logErrorAndExit other than depend on caller. Check one more error message for token and API key test cases.
Fix indentation.
@armab Sorry to keep pulling you back to this, but I figured out how to test this all, and I think it's finally in a mergeable state! |
Coverage from current
Coverage from this branch:
👍 |
st2chatop
from st2client
failures.
Fixes StackStorm/st2chatops#124
st2chatops
.robot.error
to capture uncaught error from hubot.Closes StackStorm/st2tests#170