summaryrefslogtreecommitdiff
path: root/crates/tor-netdoc/src/err.rs
Commit message (Collapse)AuthorAgeFilesLines
* Resolve warnings about ambiguous/redundant doc linksNick Mathewson2023-08-221-1/+1
| | | | | Nightly rustdoc now warns if you have a link that isn't necessary, and if you have a link that might refer to two different things.
* Fix typosDimitris Apostolou2023-07-221-1/+1
|
* tor-netdoc: Test hsdescs inners with a variety of IPT countsIan Jackson2023-06-281-1/+1
|
* tor-netdoc: Reject hsdescs with no intro pointsIan Jackson2023-06-281-0/+3
| | | | None of the existing NetdocErrorKinds seemed right.
* netdoc: Introduce HsDescErrorNick Mathewson2023-06-221-8/+0
| | | | | | | | | | For higher-level HsDesc-related functions, this type indicates where exactly an error occurred. It lets us distinguish decryption errors from parsing errors, and attribute responsibility to the hsdir, the onion service, or the user's lack of encryption. This lets us remove some just-introduced complexity in tor-hsclient.
* Generate correct ErrorKinds for hsdesc decryption failures.Nick Mathewson2023-06-211-0/+8
| | | | Part of #736
* netdoc: Rename parse_error_kind() to netdoc_error_kind().Gabriela Moldovan2023-05-111-1/+1
| | | | | | | `ParseErrorKind` was renamed to `NetdocErrorKind`, so we need to rename this acccessor too. Signed-off-by: Gabriela Moldovan <[email protected]>
* netdoc: Remove experimental-api gate from parse_decrypt_validate.Gabriela Moldovan2023-05-101-3/+0
| | | | | | | | | | | | `parse_decrypt_validate` was marked as experimental because it was unclear if the newly added `BadTimeBound` error kind belongs in `ParseErrorKind`. However, we have since renamed `ParseErrorKind` to `NetdocErrorKind` and decided to keep the new variant, so this API doesn't need to be experimental anymore. Closes arti #852 Signed-off-by: Gabriela Moldovan <[email protected]>
* netdoc: Rename `ParseError{Kind, Source}` to `NetdocError{Kind, Source}`.Gabriela Moldovan2023-05-101-15/+13
| | | | | | | | | | | `ParseErrorSource` was originally meant to represent a parsing error, this enum has since gained some variants that aren't really parsing related (`Signature`, `CertSignature`, `UntimelyDescriptor`). Since this error type is now used for general-purpose netdoc errors, let's rename `ParseError{Kind, Source}` to `NetdocError{Kind, Source}`. Signed-off-by: Gabriela Moldovan <[email protected]>
* netdoc: Mark parse_decrypt_validate as experimental.Gabriela Moldovan2023-05-021-0/+5
| | | | Signed-off-by: Gabriela Moldovan <[email protected]>
* netdoc: Add a convenience method for HS descriptor parsing.Gabriela Moldovan2023-04-251-0/+7
| | | | | | | | | This adds the `HsDesc::parse_decrypt_validate` method, which parses, decrypts, and validates HS descriptors. Closes #809 Signed-off-by: Gabriela Moldovan <[email protected]>
* 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.