commands: use new error variants for a few more commands
This commit is contained in:
@@ -41,16 +41,24 @@ impl CommandRequest for PlChangesRequest {
|
||||
}
|
||||
|
||||
fn parse(mut parts: RequestTokenizer<'_>) -> Result<Self, RequestParserError> {
|
||||
let version = parts.next().ok_or(RequestParserError::UnexpectedEOF)?;
|
||||
let version = parts.next().ok_or(Self::missing_arguments_error(0))?;
|
||||
let version = version
|
||||
.parse()
|
||||
.map_err(|_| RequestParserError::SyntaxError(0, version.to_string()))?;
|
||||
.map_err(|_| RequestParserError::SubtypeParserError {
|
||||
argument_index: 0,
|
||||
expected_type: "PlaylistVersion".to_string(),
|
||||
raw_input: version.to_string(),
|
||||
})?;
|
||||
|
||||
let window = parts
|
||||
.next()
|
||||
.map(|w| {
|
||||
w.parse()
|
||||
.map_err(|_| RequestParserError::SyntaxError(0, w.to_string()))
|
||||
.map_err(|_| RequestParserError::SubtypeParserError {
|
||||
argument_index: 1,
|
||||
expected_type: "WindowRange".to_string(),
|
||||
raw_input: w.to_string(),
|
||||
})
|
||||
})
|
||||
.transpose()?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user