override def apply()

in runtime/src/main/scala/org/apache/pekko/grpc/javadsl/GrpcExceptionHandler.scala [51:70]


      override def apply(param: Throwable): Trailers =
        param match {
          case e: ExecutionException =>
            if (e.getCause == null) INTERNAL
            else default(system)(e.getCause)
          case e: CompletionException =>
            if (e.getCause == null) INTERNAL
            else default(system)(e.getCause)
          case grpcException: GrpcServiceException => Trailers(grpcException.status, grpcException.metadata)
          case _: MissingParameterException        => INVALID_ARGUMENT
          case e: NotImplementedError              => Trailers(Status.UNIMPLEMENTED.withDescription(e.getMessage))
          case e: UnsupportedOperationException    => Trailers(Status.UNIMPLEMENTED.withDescription(e.getMessage))
          case e: StatusRuntimeException           => Trailers(e.getStatus, new GrpcMetadataImpl(e.getTrailers))
          case e: PeerClosedStreamException =>
            log(system).warning(e, "Peer closed the stream: [{}]", e.getMessage)
            INTERNAL
          case other =>
            log(system).error(other, "Unhandled error: [{}]", other.getMessage)
            INTERNAL
        }