mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-02-05 03:03:26 +00:00
use correct exception in parseCmdArg(enr.Record)
(#5009)
* use correct exception in `parseCmdArg(enr.Record)` `parseCmdArg` is expected to raise `ValueError` but for `enr.Record` we currently raise `ConfigurationError`. Change to `ValueError` instead. * lint
This commit is contained in:
parent
021babd56d
commit
73b3f40e8d
@ -1147,10 +1147,9 @@ func parseCmdArg*(T: type WalletName, input: string): T
|
|||||||
func completeCmdArg*(T: type WalletName, input: string): seq[string] =
|
func completeCmdArg*(T: type WalletName, input: string): seq[string] =
|
||||||
return @[]
|
return @[]
|
||||||
|
|
||||||
proc parseCmdArg*(T: type enr.Record, p: string): T
|
proc parseCmdArg*(T: type enr.Record, p: string): T {.raises: [ValueError].} =
|
||||||
{.raises: [ConfigurationError, Defect].} =
|
|
||||||
if not fromURI(result, p):
|
if not fromURI(result, p):
|
||||||
raise newException(ConfigurationError, "Invalid ENR")
|
raise newException(ValueError, "Invalid ENR")
|
||||||
|
|
||||||
func completeCmdArg*(T: type enr.Record, val: string): seq[string] =
|
func completeCmdArg*(T: type enr.Record, val: string): seq[string] =
|
||||||
return @[]
|
return @[]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user