Merge pull request #87 from p2p-org/do-not-write-ws-exception-stacktrace
do not call fillInStackTrace in exception constructor in happy path
This commit is contained in:
@@ -401,7 +401,8 @@ open class WsConnection(
|
|||||||
JsonRpcError(
|
JsonRpcError(
|
||||||
RpcResponseError.CODE_INTERNAL_ERROR,
|
RpcResponseError.CODE_INTERNAL_ERROR,
|
||||||
"Response not received from WebSocket"
|
"Response not received from WebSocket"
|
||||||
)
|
),
|
||||||
|
false
|
||||||
)
|
)
|
||||||
|
|
||||||
val response = Flux.from(rpcReceive.asFlux())
|
val response = Flux.from(rpcReceive.asFlux())
|
||||||
|
|||||||
@@ -19,8 +19,9 @@ import io.emeraldpay.etherjar.rpc.RpcException
|
|||||||
|
|
||||||
class JsonRpcException(
|
class JsonRpcException(
|
||||||
val id: JsonRpcResponse.Id,
|
val id: JsonRpcResponse.Id,
|
||||||
val error: JsonRpcError
|
val error: JsonRpcError,
|
||||||
) : Exception(error.message) {
|
writableStackTrace: Boolean = true
|
||||||
|
) : Exception(error.message, null, true, writableStackTrace) {
|
||||||
|
|
||||||
constructor(id: Int, message: String) : this(JsonRpcResponse.NumberId(id), JsonRpcError(-32005, message))
|
constructor(id: Int, message: String) : this(JsonRpcResponse.NumberId(id), JsonRpcError(-32005, message))
|
||||||
|
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ class NativeCallSpec extends Specification {
|
|||||||
nativeCall.quorumReaderFactory = Mock(QuorumReaderFactory) {
|
nativeCall.quorumReaderFactory = Mock(QuorumReaderFactory) {
|
||||||
1 * create(_, _, _) >> Mock(Reader) {
|
1 * create(_, _, _) >> Mock(Reader) {
|
||||||
1 * read(new JsonRpcRequest("eth_test", [], 10)) >> Mono.error(
|
1 * read(new JsonRpcRequest("eth_test", [], 10)) >> Mono.error(
|
||||||
new JsonRpcException(JsonRpcResponse.Id.from(12), new JsonRpcError(-32123, "Foo Bar", "Foo Bar Baz"))
|
new JsonRpcException(JsonRpcResponse.Id.from(12), new JsonRpcError(-32123, "Foo Bar", "Foo Bar Baz"), true)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user