mirror of
https://github.com/logos-storage/nim-ethers.git
synced 2026-01-02 21:53:08 +00:00
13 lines
353 B
Nim
13 lines
353 B
Nim
|
|
import ../basics
|
||
|
|
import ../provider
|
||
|
|
import ./encoding
|
||
|
|
|
||
|
|
func customErrorConversion*(ErrorTypes: type tuple): ConvertCustomErrors =
|
||
|
|
func convert(error: ref ProviderError): ref EthersError =
|
||
|
|
if data =? error.data:
|
||
|
|
for e in ErrorTypes.default.fields:
|
||
|
|
if error =? typeof(e).decode(data):
|
||
|
|
return error
|
||
|
|
return error
|
||
|
|
convert
|