aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-error/src/lib.rs
Commit message (Collapse)AuthorAgeFilesLines
...
* tor-hsclient: impl HasKind for InvalidTarget: ..DescriptorValidationFailedIan Jackson2023-06-091-2/+4
| | | | | | This basically always means we couldn't cope with the descriptor. We need to extend the description of OnionServiceDescriptorValidationFailed
* tor-error: Add a TODO regarding HS desc parsing errors.Gabriela Moldovan2023-05-031-0/+14
| | | | Signed-off-by: Gabriela Moldovan <[email protected]>
* Clarify what the new ErrorKinds mean.Gabriela Moldovan2023-05-031-4/+14
| | | | Signed-off-by: Gabriela Moldovan <[email protected]>
* hsclient: Use a real HsDesc instead of an unparsed string.Gabriela Moldovan2023-05-031-0/+16
| | | | Signed-off-by: Gabriela Moldovan <[email protected]>
* tor-error: Add ErrorKinds for RPC errors.Nick Mathewson2023-04-121-0/+23
| | | | | These are experimental for now so that we can change them without breaking semver.
* Merge branch 'bug804' into 'main'Nick Mathewson2023-04-111-10/+3
|\ | | | | | | | | | | | | s/ProtocolFailed/ProtocolViolation/g where possible Closes #804 See merge request tpo/core/arti!1121
| * s/ProtocolFailed/ProtocolViolation/g where possibleNeel Chauhan2023-04-081-10/+3
| |
* | Use an Enum for the description requesttranna2023-04-101-1/+1
|/
* tor-error: Rename ErrorKind::TorDirectoryUsable (from ...Broken)Ian Jackson2023-04-061-3/+3
| | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1117#note_2893986 (Not going to squash this as it has a semantic conflict with !1118, so needs a little special handling there.)
* tor-error: Introduce ErrorKind::TorDirectoryBrokenIan Jackson2023-04-051-0/+16
| | | | | | We will use this for a lack of HS directories. (These aren't chosen according to any local restrictions, so the problems with EK::NoPath and EK::NoExit don't arise.)
* tor-error: Add OnionServiceNotRunning errorIan Jackson2023-03-311-0/+13
| | | | | | We'll want this later. Define it now, though, since we've discussed it here https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1099#note_2892020
* tor-error: Put OnionService errors behind a new experimental-api featureIan Jackson2023-03-311-0/+2
|
* tor-error: Errors for hidden servicesIan Jackson2023-03-311-0/+18
| | | | | | | So far these are just the errors that occur during descriptor fetch. There will be more later as we have more code in tor-hsconn. This is very user-facing; use the "onion service" terminology.
* Disable clippy::unlinlined-format-argsNick Mathewson2023-01-271-0/+1
| | | | | | | | This warning kind of snuck up on us! (See #748) For now, let's disable it. (I've cleaned it up in a couple of examples, since those are meant to be more idiomatic and user-facing.) Closes #748.
* Rename LocalLoginFailed to ExternalToolFailed.Nick Mathewson2022-11-291-2/+2
|
* Document better what LocalProtocolViolation does not cover.Nick Mathewson2022-11-291-1/+4
|
* ptmgr: Fill in some error-related code; resolve TODOs.Nick Mathewson2022-11-281-0/+5
|
* Use ErrorKind::TorAccessFailed for misbehaving bridgesIan Jackson2022-11-081-2/+3
| | | | (Use semantic linefeed for the doc comment.)
* Run add_warnings.Nick Mathewson2022-11-031-0/+1
|
* tor-error: Rename truncated module to miscIan Jackson2022-10-241-2/+2
| | | | | This has no external API change, but makes space for other miscellaneous errors to arrive later.
* cargo fmt to remove blank linesIan Jackson2022-10-121-1/+0
| | | | | | | Apparently cargo fmt doesn't like these, which my perl rune didn't delete. This commit is precisely the result of `cargo fmt`.
* Replace all README copies in src/lib.rs with includesIan Jackson2022-10-121-7/+1
| | | | | | | | The feature we want is `#[doc = include_str!("README.md")]`, which is stable since 1.54 and our MSRV is now 1.56. This commit is precisely the result of the following Perl rune: perl -i~ -0777 -pe 's{(^//!(?!.*\@\@).*\n)+}{#![doc = include_str!("../README.md")]\n}m' crates/*/src/lib.rs
* New ErrorKind::LocalProtocolFailed.Nick Mathewson2022-09-271-0/+7
| | | | | This type is by analogy to `RemoteProtocolFailed`; we'll use it for cases when the Socks proxy refuses to talk to us.
* enable doc_auto_cfg feature on every crate when documenting for docs.rstrinity-1686a2022-08-241-0/+1
|
* Run maint/add_warning crates/*/src/{lib,main}.rsIan Jackson2022-06-231-0/+3
| | | | Update all lint blocks
* tor-error: Fix a broken intra-doc linkIan Jackson2022-06-101-1/+2
| | | | I didn't spot this in review amongst the other messages from Nightly.
* try to differentiate transient from nontransient errortrinity-1686a2022-06-081-1/+8
|
* lints: Make lint blocks consistentIan Jackson2022-05-311-0/+1
| | | | The remaining consequences of running add_warning
* lints: Add let_unit_value allow to all cratesIan Jackson2022-05-311-0/+1
| | | | | From running add_warning, with manual picking of the right hunks/lines.
* lints: Add lint block delimiters to every crateIan Jackson2022-05-311-0/+2
| | | | | | This was the result of: maint/add_warning crates/*/src/{lib,main}.rs and then manually curating the results.
* Add new FsPermissions ErrorKind.Nick Mathewson2022-05-091-0/+9
|
* Fix grammar and typosSamanta Navarro2022-04-271-1/+1
|
* tor-error: Add a new RetryTime type and related trait.Nick Mathewson2022-04-041-0/+3
|
* tor-proto: better errors when handshake fails due to untimely certsNick Mathewson2022-03-231-0/+8
| | | | | | | | | | | | | | | | | | We now check the handshake certificates unconditionally, and only report them as _expired_ as a last resort. (Rationale: if somebody is presenting the wrong identity from a year ago, it is more interesting that they are presenting the wrong ID than it is that they are doing so with an expired cert. We also now report a different error if the certificate is expired, but its expiration is within the range of reported clock skew. (Rationale: it's helpful to distinguish this case, so that we can blame the failure on possible clock skew rather than definitely attributing it to a misbehaving relay.) Part of #405.
* Provide ErrorKind::OtherIan Jackson2022-03-041-0/+10
|
* Merge branch 'clippy-allow-arc-clone' into 'main'Nick Mathewson2022-03-011-1/+0
|\ | | | | | | | | Disable clippy::clone_on_ref_ptr See merge request tpo/core/arti!352
| * Disable clippy::clone_on_ref_ptrIan Jackson2022-02-241-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This lint is IMO inherently ill-conceived. I have looked for the reasons why this might be thought to be a good idea and there were basically two (and they are sort of contradictory): I. "Calling ‘.clone()` on an Rc, Arc, or Weak can obscure the fact that only the pointer is being cloned, not the underlying data." This is the wording from https://rust-lang.github.io/rust-clippy/v0.0.212/#clone_on_ref_ptr It is a bit terse; we are left to infer why it is a bad idea to obscure this fact. It seems to me that if it is bad to obscure some fact, that must be because the fact is a hazard. But why would it be a hazard to not copy the underlying data ? In other languages, faliing to copy the underlying data is a serious correctness hazard. There is a whose class of bugs where things were not copied, and then mutated and/or reused in multiple places in ways that were not what the programmer intended. In my experience, this is a very common bug when writing Python and Javascript. I'm told it's common in golang too. But in Rust this bug is much much harder to write. The data inside an Arc is immutable. To have this bug you'd have use interior mutability - ie mess around with Mutex or RefCell. That provides a good barrier to these kind of accidents. II. "The reason for writing Rc::clone and Arc::clone [is] to make it clear that only the pointer is being cloned, as opposed to the underlying data. The former is always fast, while the latter can be very expensive depending on what is being cloned." This is the reasoning found here https://github.com/rust-lang/rust-clippy/issues/2048 This is saying that *not* using Arc::clone is hazardous. Specifically, that a deep clone is a performance hazard. But for this argument, the lint is precisely backwards. It's linting the "good" case and asking for it to be written in a more explicit way; while the supposedly bad case can be written conveniently. Also, many objects (in our codebase, and in all the libraries we use) that are Clone are in fact simply handles. They contain Arc(s) (or similar) and are cheap to clone. Indeed, that is the usual case. It does not make sense to distinguish in the syntax we use to clone such a handle, whether the handle is a transparent Arc, or an opaque struct containing one or more other handles. Forcing Arc::clone to be written as such makes for code churn when a type is changed from Arc<Something> to Something: Clone, or vice versa.
* | Fix typo in messageNick Mathewson2022-02-281-1/+1
| |
* | EK::RemoteProtocolFailed replaces OtherRemoteIan Jackson2022-02-281-6/+14
| | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/355#note_2781816
* | Introduce ErrorKind::OtherRemoteIan Jackson2022-02-281-0/+9
| | | | | | | | | | | | | | | | | | | | arti-hyper wants to be able to have a kind for TLS failure. Given that arti-hyper is above arti-client, this shows that callers above arti-client might need to invent kinds for their own errors. Possibly this means we need other Other errors for other locations. If we have pluggable components we might even want OtherTorError.
* | Merge branch 'proto_handshake_err' into 'main'Nick Mathewson2022-02-241-2/+2
|\ \ | | | | | | | | | | | | | | | | | | tor-proto: Split up a couple of handshake-based errors Closes #359 and #358 See merge request tpo/core/arti!344
| * | tor-proto: Split IoErr based on when it occursNick Mathewson2022-02-231-2/+2
| |/ | | | | | | | | | | | | We want to distinguish handshake failures from errors later on in the channel's lifetime. Closes #359.
* / Give specific error kinds to different END reasonsNick Mathewson2022-02-231-1/+53
|/ | | | Closes #360.
* Cleanups on !340 from @dizietIan Jackson2022-02-231-2/+8
|
* Make NoLock into BadApiUsage.Nick Mathewson2022-02-221-12/+0
| | | | | | To implement this, we had to refactor the tor_circmgr api for flushing state changes to disk, so that it checks if it has the lock, and only then tries to store.
* Eliminate RequestedResourceAbsent kind.Nick Mathewson2022-02-221-7/+0
| | | | | | | | There was only one use of this, and it was in as-yet-unused relay-only code. Removing this type required refactoring the relay onion handshake code to use its own error type, which is probably clever anyway.
* Fold NamespaceFull into BadApiUsage.Nick Mathewson2022-02-221-12/+0
|
* Rename RemoteNameError to RemoteHostNotFoundNick Mathewson2022-02-221-4/+4
| | | | | This is a bit ugly but we need it to work around the problem where exits aren't always clear about _why_ a hostname lookup failed.
* Replace TorNetworkError with TorDirectoryErrorNick Mathewson2022-02-221-6/+6
| | | | | | This is still not as specific as we want; but there's already a TODO comment in tor-dirclient::err about fixing that at some point in the future.
* Rename TorConnectionFailed to TorAccessFailedNick Mathewson2022-02-221-1/+1
|