Skip to content

Commit 9a7212e

Browse files
committed
fix: checkError
1 parent edd8e72 commit 9a7212e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Sources/Web3Core/EthereumNetwork/Request/APIRequest+Methods.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,12 @@ func spelunkData(value: Any?) -> (message: String, data: String)? {
3434
return nil
3535
}
3636

37-
if let error = value as? JsonRpcErrorObject.RpcError, let data = error.data as? String {
38-
return spelunkRpcError(error.message, data: data)
37+
if let error = value as? JsonRpcErrorObject.RpcError {
38+
if let data = error.data as? String {
39+
return spelunkRpcError(error.message, data: data)
40+
} else {
41+
return spelunkData(value: error.data)
42+
}
3943
}
4044

4145
// Spelunk further...

0 commit comments

Comments
 (0)