Skip to content

Commit

Permalink
PM-3130: Separate tracing event for request handling error.
Browse files Browse the repository at this point in the history
  • Loading branch information
aakoshh committed Jun 8, 2021
1 parent d7e0238 commit 9868863
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Expand Up @@ -103,7 +103,7 @@ object InterpreterService {
sendMessage(toResponse(result))
}
.handleErrorWith { case NonFatal(ex) =>
tracer(Error(ex))
tracer(InterpreterError(request, ex))
}
}.void

Expand All @@ -116,8 +116,7 @@ object InterpreterService {
): F[Unit] =
Concurrent[F].start {
command.handleErrorWith { case NonFatal(ex) =>
val err = new RuntimeException(s"Error handling request $request", ex)
tracer(Error(err))
tracer(InterpreterError(request, ex))
}
}.void

Expand Down
Expand Up @@ -17,6 +17,12 @@ object InterpreterEvent {
message: InterpreterMessage with FromInterpreter
) extends InterpreterEvent

/** Error handling a Service message by the Interpreter. */
case class InterpreterError(
message: InterpreterMessage with Request with FromService,
error: Throwable
) extends InterpreterEvent

/** An unexpected error. */
case class Error(error: Throwable) extends InterpreterEvent
}

0 comments on commit 9868863

Please sign in to comment.