More consistent MQTT error messages
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Alex Mikhalev 2020-09-30 14:42:05 -06:00
parent b8a9c24444
commit 6043f4bac7

View File

@ -11,7 +11,7 @@ pub struct SectionId(pub crate::model::SectionId);
impl SectionId {
fn get_section(self, sections: &Sections) -> Result<SectionRef, RequestError> {
sections.get(&self.0).cloned().ok_or_else(|| {
RequestError::with_name(ErrorCode::NoSuchSection, "section not found", "section")
RequestError::with_name(ErrorCode::NoSuchSection, "no such section", "section")
})
}
}
@ -114,7 +114,7 @@ impl IRequest for CancelSectionRunIdRequest {
} else {
Err(RequestError::with_name(
ErrorCode::NoSuchSectionRun,
"section run does not exist",
"no such section run",
"section run",
))
}