mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 23:54:22 +01:00
pyln-proto: make an error message more detailed
Easier to figure out what's going wrong
This commit is contained in:
@@ -248,7 +248,7 @@ other types. Since 'msgtype' is almost identical, it inherits from this too.
|
||||
fieldname, s = s.split('=', 1)
|
||||
f = self.find_field(fieldname)
|
||||
if f is None:
|
||||
raise ValueError("Unknown field name {}".format(fieldname))
|
||||
raise ValueError("Unknown field name '{}'. Expected one of [{}])".format(fieldname, ','.join(str(f) for f in self.fields)))
|
||||
ret[fieldname], s = f.fieldtype.val_from_str(s)
|
||||
if s[0] == ',':
|
||||
s = s[1:]
|
||||
|
||||
Reference in New Issue
Block a user