Skip to content
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

#711 proposal for better error messages.. #728

Merged
merged 1 commit into from
Aug 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,12 @@ object UnicomplexBoot extends LazyLogging {
for ((listenerName, config) <- boot.listeners) yield {
val responseFuture = Unicomplex(actorSystem).uniActor ? StartListener(listenerName, config)
responseFuture.onComplete {
case Failure(t) => logger.error(s"Failed to start the listener $listenerName.", t)
case Success(StartFailure(t)) => logger.error(s"Failed to start the listener $listenerName.", t)
case Failure(t) if (t.isInstanceOf[TimeoutException]) =>
logger.error(s"The Unicomplex could not start the listener, $listenerName, within $to.", t)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it guaranteed that TimeoutException would be thrown only after to? Some other component may timeout on some other operation and could potentially send TimeoutException back to Unicomplex?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is the problem I'm trying to deal with. That is happening a lot and the error message makes it confusing what's happening. If some other operation times out, that should come back in Success(StartFailure(t)) case and you will see that in the stack trace.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So in your case what that user would see is:

The Unicomplex reported a start failure for the listener, foo listener.  {TimeoutException.stacktrace}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akara Any opinion on this?

And I hope all is well!

case Failure(t) =>
logger.error(s"The Unicomplex failed to start the listener, $listenerName.", t)
case Success(StartFailure(t)) =>
logger.error(s"The Unicomplex reported a start failure for the listener, $listenerName.", t)
case _ =>
}
responseFuture
Expand Down