summaryrefslogtreecommitdiff
path: root/crates/tor-netdoc/src/err.rs
Commit message (Collapse)AuthorAgeFilesLines
* Replace `Option<Pos>` with `Pos` in `ParseError`.Nick Mathewson2022-11-151-20/+12
| | | | | | | | | | | | | | | We already have `Pos::Unknown` for an error at an unknown location and `Pos::None` for an error where no location is sensible. There's no reason to have an additional `Option` here. Additionally, the use of `Option` gave us a bug where our old `ParseError::at_pos()` method didn't actually set the position unless the position was already set. That's not what we want! Fixes #640. Finally, we have to fix a test that was a bit broken because it was working around #640.
* tor-netdoc: Add a new ErrorKind for EmptyLine.Nick Mathewson2022-11-151-0/+3
| | | | | Empty lines were previously reported as BadKeyword, which is confusing.
* tor-proto: split and elaborate tor_bytes::Error instancesNick Mathewson2022-06-231-0/+3
| | | | | | | | | Some of these were for decoding particular objects (we now say what kind of objects), and some were unrelated tor_cert errors that for some reason we had shoved into a tor_bytes::Error. There is now a separate tor_cert::CertError type, independent from tor_cert's use of `tor_bytes::Error` for parsing errors.
* Netdoc: add accessor to error for ParseErrorKindNick Mathewson2022-06-071-0/+5
| | | | | The kind type was already public, but we didn't give the user any way to get it.
* Resolve the new `derive_partial_eq_without_eq` lint.Nick Mathewson2022-05-231-1/+1
| | | | It's a little overzealous sometimes, but it's mostly to the good.
* Replace a match with some as_ref and asIan Jackson2022-03-161-4/+1
| | | | | | | The match was doing a deref coercion. Found by current nightly's needless_match (whose suggestion doesn't compile, https://github.com/rust-lang/rust-clippy/issues/8551 )
* Fix a rustdoc error.Nick Mathewson2022-02-151-1/+1
|
* Refactor tor-netdoc a bit more, to use Bug right.Nick Mathewson2022-02-151-4/+23
|
* Minimal compilation fix: InternalError=>BugNick Mathewson2022-02-151-2/+2
| | | | This is a followup for !314 and !310 to fix compilation on main.
* Refactor tor_netdoc::ErrorNick Mathewson2022-02-141-152/+199
| | | | | | | | | | | | | | | This error type doesn't impement HasKind, since the kind will depend on context. However, the existing implementation was pretty messy and inconsistent: Some errors had positions, some didn't. Some took messages as str, some as String. Some had internal errors that were somewhat orthogonal to their actual types. This commit refactors tor_netdoc::Error to use a ParseErrorKind, and adds a set of convenience functions to add positions and messages to the errors that need them.
* netdoc: Make doc-build errors a separate typeNick Mathewson2022-02-141-5/+14
| | | | | Every other case of tor_netdoc::Error means a parse failure. This one, though, means a failure to construct a document.
* netdoc: remove Error::Untimely.Nick Mathewson2022-02-141-11/+0
| | | | Nothing creates this.
* address clippy's latest lintDaniel Eades2021-12-201-0/+4
|
* Resolve roughly half of the XXXXs.Nick Mathewson2021-12-061-5/+5
| | | | | | | | We want to only use TODO in the codebase for non-blockers, and open tickets for anything that is a bigger blocker than a TODO. These XXXXs seem like definite non-blockers to me. Part of arti#231.
* Document every macro.Nick Mathewson2021-09-071-0/+2
| | | | | (The nightly version of clippy now includes macros for its missing_docs_in_private_items lint.)
* Move all crates into a `crates` subdirectory.Nick Mathewson2021-08-271-0/+423
This will cause some pain for now, but now is really the best time to do this kind of thing.