mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-01-12 21:34:33 +00:00
No more blind except
This commit is contained in:
parent
9964a55772
commit
9aae2f9463
@ -209,7 +209,7 @@ proc processInteger*(v: string, o: var int): ConfigStatus =
|
||||
try:
|
||||
o = parseInt(v)
|
||||
result = Success
|
||||
except:
|
||||
except ValueError:
|
||||
result = ErrorParseOption
|
||||
|
||||
proc processFloat*(v: string, o: var float): ConfigStatus =
|
||||
@ -217,7 +217,7 @@ proc processFloat*(v: string, o: var float): ConfigStatus =
|
||||
try:
|
||||
o = parseFloat(v)
|
||||
result = Success
|
||||
except:
|
||||
except ValueError:
|
||||
result = ErrorParseOption
|
||||
|
||||
proc processAddressPortsList(v: string,
|
||||
@ -230,11 +230,11 @@ proc processAddressPortsList(v: string,
|
||||
var tas6: seq[TransportAddress]
|
||||
try:
|
||||
tas4 = resolveTAddress(item, IpAddressFamily.IPv4)
|
||||
except:
|
||||
except CatchableError:
|
||||
discard
|
||||
try:
|
||||
tas6 = resolveTAddress(item, IpAddressFamily.IPv6)
|
||||
except:
|
||||
except CatchableError:
|
||||
discard
|
||||
if len(tas4) == 0 and len(tas6) == 0:
|
||||
result = ErrorParseOption
|
||||
@ -296,7 +296,7 @@ proc processPrivateKey(v: string, o: var PrivateKey): ConfigStatus =
|
||||
try:
|
||||
o = initPrivateKey(v)
|
||||
result = Success
|
||||
except:
|
||||
except CatchableError:
|
||||
result = ErrorParseOption
|
||||
|
||||
# proc processHexBytes(v: string, o: var seq[byte]): ConfigStatus =
|
||||
@ -304,7 +304,7 @@ proc processPrivateKey(v: string, o: var PrivateKey): ConfigStatus =
|
||||
# try:
|
||||
# o = fromHex(v)
|
||||
# result = Success
|
||||
# except:
|
||||
# except CatchableError:
|
||||
# result = ErrorParseOption
|
||||
|
||||
# proc processHexString(v: string, o: var string): ConfigStatus =
|
||||
@ -312,7 +312,7 @@ proc processPrivateKey(v: string, o: var PrivateKey): ConfigStatus =
|
||||
# try:
|
||||
# o = parseHexStr(v)
|
||||
# result = Success
|
||||
# except:
|
||||
# except CatchableError:
|
||||
# result = ErrorParseOption
|
||||
|
||||
# proc processJson(v: string, o: var JsonNode): ConfigStatus =
|
||||
@ -320,7 +320,7 @@ proc processPrivateKey(v: string, o: var PrivateKey): ConfigStatus =
|
||||
# try:
|
||||
# o = parseJson(v)
|
||||
# result = Success
|
||||
# except:
|
||||
# except CatchableError:
|
||||
# result = ErrorParseOption
|
||||
|
||||
proc processPruneList(v: string, flags: var PruneMode): ConfigStatus =
|
||||
|
@ -59,7 +59,7 @@ proc setupWhisperRPC*(node: EthereumNode, keys: WhisperKeys, rpcsrv: RpcServer)
|
||||
# this is the general behaviour we want.
|
||||
try:
|
||||
waitFor node.setPowRequirement(pow)
|
||||
except:
|
||||
except CatchableError:
|
||||
trace "setPowRequirement error occured"
|
||||
result = true
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user