Skip to content

Commit

Permalink
onErrorMapper
Browse files Browse the repository at this point in the history
  • Loading branch information
Angainor17 committed Oct 19, 2020
1 parent 804717b commit 30b76ea
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class GrpcChuckerInterceptor(
private val port: Int = 0,
private val context: Context,
private val collector: ChuckerCollector = ChuckerCollector(context),
private val onErrorMapper: OnErrorMapper? = null,
) : ClientInterceptor {
override fun <ReqT : Any?, RespT : Any?> interceptCall(method: MethodDescriptor<ReqT, RespT>?, callOptions: CallOptions?, next: Channel): ClientCall<ReqT, RespT> {
return object :
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.chuckerteam.chucker.api

import io.grpc.Metadata
import io.grpc.Status

/**
* Обработка ошибки исходя из переменных Status и Metadata
* Необходимо из-за того, что модель ошибки индивидуальна для конкретного API
*/
public interface OnErrorMapper {

public fun mapErrorMessageToString(status: Status, metadata: Metadata): String

}

0 comments on commit 30b76ea

Please sign in to comment.