mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-27 06:47:13 +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] =
|
||||
return @[]
|
||||
|
||||
proc parseCmdArg*(T: type enr.Record, p: string): T
|
||||
{.raises: [ConfigurationError, Defect].} =
|
||||
proc parseCmdArg*(T: type enr.Record, p: string): T {.raises: [ValueError].} =
|
||||
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] =
|
||||
return @[]
|
||||
|
Loading…
x
Reference in New Issue
Block a user