summaryrefslogtreecommitdiff
path: root/crates/tor-error/src
Commit message (Collapse)AuthorAgeFilesLines
* tor-error: use `Display` for backtrace captured by `BugRepr`Steven Engler2024-10-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Before: ```text 2024-10-29T01:57:31Z ERROR arti: error: internal error (bug) at crates/arti/src/lib.rs:378:27: foo Backtrace [{ fn: "tor_error::internal::ie_backtrace::capture", file: "./crates/tor-error/src/internal.rs", line: 21 }, { fn: "tor_error::internal::Bug::new_inner", file: "./crates/tor-error/src/internal.rs", line: 105 }, { fn: "tor_error::internal::Bug::new", file: "./crates/tor-error/src/internal.rs", line: 94 }, { fn: "arti::main_main", file: "./crates/arti/src/lib.rs", line: 378 }, ... ``` After: ```text 2024-10-29T01:58:23Z ERROR arti: error: internal error (bug) at crates/arti/src/lib.rs:378:27: foo 0: tor_error::internal::ie_backtrace::capture at ./crates/tor-error/src/internal.rs:21:27 1: tor_error::internal::Bug::new_inner at ./crates/tor-error/src/internal.rs:105:24 2: tor_error::internal::Bug::new at ./crates/tor-error/src/internal.rs:94:9 3: arti::main_main at ./crates/arti/src/lib.rs:378:27 ... ```
* Remove Rpc* variants from tor_error::ErrorKindNick Mathewson2024-10-171-40/+0
| | | | | | | | | | | | | These are not regular ErrorKinds, since they can never occur in an error that's meant to be returned from a Rust API like `arti-client`. Instead, they only exist for errors returned from RpcError. (I can't find the place where we discussed this previously, but the rationale is that if an ErrorKind never makes sense in response to something that the user does from Rust, we should never have that be an ErrorKind. The fact that the removed kinds do not actually appear outside the RPC system suggests that this is reasonable.)
* tor-error: Make "futures" dependency optional.Nick Mathewson2024-10-091-0/+1
| | | | | | This is part of an effort to make arti-rpc-client-core (and future similar tools) able to use our very-low-level crates without depending on things they don't need.
* Merge branch 'miri-1' into 'main'Ian Jackson2024-10-091-2/+2
|\ | | | | | | | | Add some more miri tests See merge request tpo/core/arti!2502
| * tor-error: Disable backtraces under miri, even if cargo feature enabledIan Jackson2024-10-081-2/+2
| |
* | tor-{error,rpcbase}: Add new RPC error codes from spec.Nick Mathewson2024-10-071-0/+11
|/ | | | | | These, like the other RPC-only error kinds, probably don't belong in `tor-error`. But for now, that's where they all are, and moving them is out of scope for this branch. See #1668.
* Upgrade to derive_more version 1.0.0Nick Mathewson2024-09-251-64/+62
| | | | | | The `derive_more` crate broke backward compatibility with this version, so this change involved quite a few manual fixups. With luck, they'll keep compatibility for some while in the future.
* Merge branch 'rpc-describe' into 'main'Nick Mathewson2024-08-131-0/+12
|\ | | | | | | | | RPC: Method to expose a list of RPC methods. See merge request tpo/core/arti!2332
| * tor-error: implement HasKind on void::Void and Infallible.Nick Mathewson2024-08-121-0/+12
| | | | | | | | | | | | | | | | | | | | | | `void::Void` represents the type of an object that can't be constructed. It's especially useful as the error type of an infallible function. `void::Void` already implements `std::error::Error`, so all we need to do to use it as a "can't happen" error type in our code is to have it also implement `HasKind`. Also implement HasKind for Infallible while we're at it.
* | Use std::backtrace instead of backtrace crateRobin Leander Schröder2024-08-011-5/+3
|/ | | | | Removes resolve_backtraces from rtmock since it is no longer needed as stdlib's backtraces automatically lazily resolve without needing a &mut.
* rpc: Rename the error codes for something like consistency.Nick Mathewson2024-07-251-1/+1
|
* rpc: split "method not found"Nick Mathewson2024-07-251-0/+6
| | | | | We've wanted separate error codes for "no such method exists" and "this method exists, but this object doesn't have it."
* Re-run maint/add_warning.Nick Mathewson2024-05-061-2/+2
| | | | This commit is automatically generated.
* tor-error: Fix message for LocalResourceExhaustedIan Jackson2024-04-231-1/+1
|
* tor-error: Add ErrorKind::LocalResourceExhaustedIan Jackson2024-04-231-0/+6
|
* derive-deftly: Change some docs referencesIan Jackson2024-04-031-1/+1
| | | | Found by "git grep adhoc" and manual inspection.
* Run maint/add_warning.Nick Mathewson2024-03-134-0/+4
|
* deny clippy::unchecked_duration_subtractiontrinity-1686a2024-02-291-0/+1
|
* tor-error: Backtrace: Remove a Captured(...) from a DisplayIan Jackson2024-01-311-1/+1
| | | | | Prompted by clippy complaining that the content wasn't ever read other than by the autogenerated Debug impl.
* tor-error: Correct docs for ErrorReport to reflect improved situationIan Jackson2023-12-121-2/+4
|
* tor-error: tests: Demonstrate warn_report on bare error and anyhowIan Jackson2023-12-121-0/+35
|
* tor-error: ErrorReport: impl for StdError + 'staticIan Jackson2023-12-121-0/+7
|
* tor-error: ErrorReport: remove Sized bound from traitIan Jackson2023-12-121-1/+1
| | | | This will let us impl for dyn StdError.
* tor-error: ErrorReport: move blanket impl code into implIan Jackson2023-12-121-2/+4
| | | | | This impl can only compile for Self: Sized. This will let us remove the Sized bound from the trait itself.
* tor-error: ErrorReport: sealIan Jackson2023-12-122-1/+10
| | | | | | We're going to need to make change to this trait which would be breaking for out-of-crate implementors. This should have been sealed all along.
* tor-error: Introduce ErrorKind::LocalResourceAlreadyInUseIan Jackson2023-12-111-0/+22
| | | | | | | | Our HSS code isn't going to work if you run more than one copy. Soon we'll detect this (via our use of tor_persist). There may be other places this ought to be used. Eg if we get EADDRINUSE from trying to set up a proxy, maybe ...
* tor-error: fmt_ending_ok: Permit messages ending in ascii ellipsisIan Jackson2023-11-201-0/+1
| | | | | | | | | Tbis will result in "some message ...: the error" which I think is OK. We don't use a Unicode single-character ellipsis because that character can be hard to read at font sizes which are otherwise OK for text, and because use of non-ascii in logfiles and error messages is unecessary and might cause unnecessary trouble (for example, if the log messages end up going somewhere which isn't 100% valid UTF-8).
* tor-error: fmt_ending_ok: Implement with a direct matchIan Jackson2023-11-201-1/+5
| | | | | Possibly at some point in the past, matching a slice directly wasn't possible. But it is now.
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-233-0/+3
|
* tor-error: Remove KeystoreFsPermissions variant.Gabriela Moldovan2023-08-081-12/+0
| | | | | | | | According to the `ErrorKind` lumping guidelines, `KeystoreFsPermissions` should be lumped with `FsPermissions`: they represent the same type of error, and their "location" is the same ("Host"). Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1315#note_2916455
* Run add_warnings on all files.Nick Mathewson2023-08-041-2/+2
|
* retry-error: Provide fmt_error_with_sources in retry-errorIan Jackson2023-07-191-16/+3
| | | | | This code came from tor-error. So now tor-error depends on retry-error.
* clippy: tor-error: Use convert::identity for into_internal!Ian Jackson2023-07-101-0/+4
| | | | | | | | | | This launders the closure so that clippy's clippy::redundant_closure_call can't see it. We can't have a local #[allow] because it would be on an expression, which isn't allowed on stable. This avoids having to use more clumsy idioms at call sites.
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-104-0/+4
|
* Fix warn_report and error_report macros.Nick Mathewson2023-07-071-4/+10
| | | | | | | | | Originally they didn't check err.kind(), since err.kind() can never increase their severity. We lost that behavior with !1386, and we became dependent on it with arti!1383. Since they both merged at the same time, CI broke. This patch restores their original behavior.
* tor-error: tracing module: Use macro to generate macrosIan Jackson2023-07-071-91/+53
| | | | | | | | | | This abolishes some quintuplication. The output is identical except that: * The syntax display in the rustdoc output for the resulting macros seems to have somewhat less whitepsace. * The whimsical error messages in the examples are all identical. Ah well.
* tor-error: tracing module: Fix link to tracing macroIan Jackson2023-07-071-1/+1
|
* Merge branch 'report-bugs-v2' into 'main'Nick Mathewson2023-07-072-0/+194
|\ | | | | | | | | Optional tracing support in tor-error for error reporting See merge request tpo/core/arti!1379
| * event_report: assert correctness of format endingNick Mathewson2023-07-071-0/+20
| | | | | | | | | | (Also, document that this static assertion is the reason why you are seeing a confusing error message.)
| * tor-error: Add optional tracing supportNick Mathewson2023-07-072-0/+174
| | | | | | | | | | | | | | | | | | | | The main contribution here is a set of convenience macros for logging error `Report`s. Notably, this macros always logs `Internal` and `BadAspiUsage` errors at `WARN`, unless they are already at `ERROR` or more. This is a little tricky because `tracing::event!()` requires its Level argument to be a constant.
* | Run add_warning to remove `missing_panics_doc` deny.Nick Mathewson2023-07-061-1/+0
|/ | | | Closes #950.
* Add TODO comments about possibly migrating away from the backtrace crate.Nick Mathewson2023-07-051-0/+2
|
* tor-error: Make KeystoreFsPermissions experimental for nowIan Jackson2023-06-291-0/+3
| | | | Let's defer this decision.
* tor-error: Add KeystoreAccessFailed, KeystoreFsPermissions to ErrorKind.Gabriela Moldovan2023-06-281-0/+19
|
* tor-error: Add KeystoreCorrupted to ErrorKind.Gabriela Moldovan2023-06-281-0/+10
|
* tor-error: Mark define_asref_dyn_std_error as non-experimentalNick Mathewson2023-06-231-1/+0
| | | | | (I see no problems with this macro. In the worst case, we deprecate it someday.)
* tor-error: Stabilize OnionService error kindsNick Mathewson2023-06-221-7/+0
|
* tor-error: typo fix in a comment.Nick Mathewson2023-06-221-1/+1
|
* Remove onion service descriptor-related errorkinds.Nick Mathewson2023-06-221-46/+0
| | | | | | | | These have been subsumed by other errorkinds, mostly OnionServiceProtocolViolation and TorProtocolViolation. In particular please review the change in tor-hsclient closely; I am not sure about the new errorkinds for the error there.
* Merge branch 'socks_errorkinds' into 'main'Nick Mathewson2023-06-221-16/+6
|\ | | | | | | | | | | | | Generate correct-ish socks5 errors for onion service errors. Closes #736 See merge request tpo/core/arti!1279