rust-s7-datatypes/src/errors.rs

14 lines
332 B
Rust
Raw Normal View History

2021-10-16 15:17:09 +00:00
use anyhow::{anyhow, Error};
pub fn serial_error(name: String, pos: u32) -> Error {
anyhow!(
"Cannot convert Serial data for type '{}' at position {}.",
name,
pos
)
}
pub fn s7_read_error(name: String, pos: u32) -> Error {
anyhow!("Cannot read Byte for type '{}' at position {}.", name, pos)
}