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

Remove error correction, use new errorCode #347

Merged
merged 1 commit into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion emerald-grpc
43 changes: 0 additions & 43 deletions src/main/kotlin/io/emeraldpay/dshackle/rpc/ErrorProcessing.kt

This file was deleted.

10 changes: 4 additions & 6 deletions src/main/kotlin/io/emeraldpay/dshackle/rpc/NativeCall.kt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ open class NativeCall(
private val signer: ResponseSigner,
config: MainConfig,
private val tracer: Tracer,
private val errorCorrector: ErrorCorrector,
) {

private val log = LoggerFactory.getLogger(NativeCall::class.java)
Expand Down Expand Up @@ -174,12 +173,11 @@ open class NativeCall(
.setSucceed(!it.isError())
.setId(it.id)
if (it.isError()) {
it.error?.let { _ ->
val fixedError = errorCorrector.correctError(it)
result.setErrorMessage(fixedError.message)
.setErrorCode(fixedError.id)
it.error?.let { error ->
result.setErrorMessage(error.message)
.setItemErrorCode(error.id)

fixedError.data?.let { data ->
error.data?.let { data ->
result.setErrorData(data)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class NativeCallSpec extends Specification {
config.cache = cacheConfig
config.passthrough = passthrough

new NativeCall(upstreams, signer, config, Stub(Tracer), Stub(ErrorCorrector))
new NativeCall(upstreams, signer, config, Stub(Tracer))
}

def "Tries router first"() {
Expand Down
93 changes: 0 additions & 93 deletions src/test/kotlin/io/emeraldpay/dshackle/rpc/ErrorProcessingTest.kt

This file was deleted.

Loading