-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Description
Nom 5 don't have custom ErrorKind now.
But I want to return with custom error kind in this situation.
tox/src/toxcore/messenger/packet/msi.rs
Lines 237 to 246 in a8d0e56
| let request = if let Some(request) = request { | |
| request | |
| } else { | |
| return Err(Err::Error((input, ErrorKind::NoneOf))); | |
| }; | |
| let capabilities = if let Some(capabilities) = capabilities { | |
| capabilities | |
| } else { | |
| return Err(Err::Error((input, ErrorKind::NoneOf))); | |
| }; |
It is needed when the Msi packet don't have a Request subpacket or Capability subpacket,
Now we return with ErrorKind::NoneOf, but it would be better to return with exact explanation why the error occurred.
The error kinds I want to use are
const NOM_CUSTOM_ERR_REQUEST_SUBPACKET_OMITTED: u32 = 1;
const NOM_CUSTOM_ERR_CAPABILITIES_SUBPACKET_OMITTED: u32 = 2;
Any idea?
Metadata
Metadata
Assignees
Labels
No labels