summaryrefslogtreecommitdiff
path: root/crates/tor-bytes/src/err.rs
Commit message (Collapse)AuthorAgeFilesLines
* tor-bytes: deprecate always_bug with From traitEmil Engler2023-08-171-0/+11
| | | | | | This commit deprecates the `EncodeError::always_bug` function with a `From<EncodeError> for Bug` trait, which is a more semantically correct way to perform this action.
* Change tor_bytes::Error::BadMessage to a Cow.Nick Mathewson2023-02-091-0/+9
| | | | | | | | | | Actually, to avoid making a breaking change, I'm deprecating BadMessage and creating a new InvalidMessage variant that takes a Cow. This way I don't need to track every crate that re-exposes tor_bytes::Error and call this a breaking change in those. Making this change will allow tor_bytes errors to be much more helpful.
* tor-bytes: Implement conversion from EncodeError to BugIan Jackson2023-01-241-1/+16
|
* Add a Bug variant to tor-bytes::EncodeError.Nick Mathewson2022-07-111-1/+7
| | | | This will help down the line as we make more writers fallible.
* tor-bytes: Split EncodeError from ErrorNick Mathewson2022-06-231-3/+13
| | | | | | | | | | | Since there is currently only one error type that can occur when encoding, it doesn't make sense to use the full Error type here. This split will help us downstream, as we no longer need to categorize tor_bytes::Error as "an error in encoding or decoding". I considered renaming Error to DecodeError, but that had pretty huge downstream effects, and didn't seem to be worth it.
* Style fixes to tor-bytes errors.Nick Mathewson2022-06-221-5/+9
| | | | | Also note an issue with the design of tor-bytes::Error that should probably go in a separate MR.
* tor-bytes: Prepare errors for nested reader/writerIan Jackson2022-06-091-1/+5
| | | | Writing is going to be able to give errors too.
* Make Bug from InternalError, add bad_api_usage! and into_bad_api_usage!Ian Jackson2022-02-151-2/+2
| | | | Including supporting machinery, new kind field, etc.
* tor-bytes: Use InternalError.Nick Mathewson2022-02-091-2/+15
| | | | | | This crate's Error type is too low-level to have an ErrorKind, but it does make sense to use InternalError for the internal errors here.
* Move all crates into a `crates` subdirectory.Nick Mathewson2021-08-271-0/+29
This will cause some pain for now, but now is really the best time to do this kind of thing.