Closed Masterchef365 closed 5 years ago
I just merge a bug fix, please rebase to resolve the conflict.
Alright, I finished rebasing. I haven't added InvalidData yet because I'm not sure if InvalidInput would be a better choice?
InvalidData Data not valid for the operation were encountered.
Unlike InvalidInput, this typically means that the operation parameters were valid, however the error was caused by malformed input data.
For example, a function that reads a file into a string will error with InvalidData if the file's contents are not valid UTF-8.
As I understand:
InvalidInput
.InvalidData
.InvalidInput
InvalidData
Ah okay that makes much more sense. I've replaced all of the panic!()
s with return Err(InvalidData,...). Let me know if I missed anything more.
Thanks
@Masterchef365
Add some related chain call API, and added a release note (v0.3.0)
Also published to crates.io (https://crates.io/crates/escposify/0.3.0)
Each call to the printer has the potential to fail due to IO errors. Instead of ignoring these, the method should return the result. If one method call results in several writes, the total of their written bytes is returned.