summaryrefslogtreecommitdiff
path: root/crates/tor-error/src
Commit message (Collapse)AuthorAgeFilesLines
* tor-error: New ErrorKind for rejected documents.Nick Mathewson2026-05-122-3/+17
|
* arti: set_protocol_warning_mode to Warn or Off in setup_loggingmoumenalaoui2026-04-081-9/+20
|
* tor-error: add runtime ProtocolWarningMode and promote TorProtocolViolation ↵moumenalaoui2026-03-271-1/+182
| | | | in event_report!
* tor-error: Port to web-time-compat.Nick Mathewson2026-03-261-9/+9
|
* Fix grammar typosTobias Stoeckmann2026-03-151-3/+3
|
* Fix word duplicate typosTobias Stoeckmann2026-03-151-1/+1
|
* Allow clippy::collapsible_if to triggerGabriela Moldovan2026-02-161-0/+1
| | | | | | | | | `clippy::collapsible_if` started triggering after bumping the MSRV to 1.88. Since this triggers from a lot of places, and since there even are a couple of instances where we explicitly allow `clippy::collapsible_ifs`, I've opened #2342 for deciding what to do about it.
* maint/add_warning: Run script to add new warningGabriela Moldovan2026-01-271-0/+1
| | | | This adds the lint to all our crates.
* tor-error: Provide new `bug_context` method on Bug and Result<_, Bug>Ian Jackson2025-12-011-0/+33
| | | | | This allows call sites which have a `Bug` to add additional context, beyond just the stack trace.
* Merge branch 'readd-error-deduping' into 'main'Ian Jackson2025-11-201-10/+3
|\ | | | | | | | | Revert "retry-error: stop trying to dedup error msgs" See merge request tpo/core/arti!3474
| * Revert "retry-error: stop trying to dedup error msgs"Steven Engler2025-11-181-10/+3
| | | | | | | | | | | | | | This reverts commit e0efb477df868baf09d37de99e8e346136e66140. There wasn't a consensus on this change, so sticking with the status quo.
* | error: Improve http error status code docs.Nick Mathewson2025-11-191-0/+10
| |
* | tor-error: rustfmtNick Mathewson2025-11-181-63/+64
| |
* | tor-error: Provide a more reasonable API for http status codes.Nick Mathewson2025-11-182-6/+9
| |
* | tor-error: Add support for ErrorKind->HTTP status conversionNick Mathewson2025-11-182-0/+78
|/ | | | | | | It makes more sense to have the conversion here, so it can use an exhaustive match over ErrorKind. This isn't the final API; I'm just moving the code from `arti`.
* retry-error: stop trying to dedup error msgsSteven Engler2025-11-131-3/+10
|
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-065-5/+5
| | | | Run maint/add_warning
* Remove "doc_auto_cfg" incantation from all crates.Nick Mathewson2025-09-291-1/+1
| | | | This feature has been removed from nightly, in favor of doc_cfg.
* tor-error: allow only error given to `_report!` macrosSteven Engler2025-08-181-0/+25
| | | | | | | | | | This is useful when you create an `internal!` error and then immediately report it. If the `_report!` macro also requires a message, then you need to provide two messages for the error, which doesn't always make sense. This is already possible anyways with `warn_report!(e,)`. Now you don't need the comma.
* tor-error: update `_report!` macros to support tracing fieldsSteven Engler2025-08-181-38/+15
| | | | | | | | | | This requires that we put the error in a field. There are two issues that we'll fix in the next two commits: 1. Errors are no longer formatted with `ErrorReport`. 2. Errors will be in the first field, but long (or multiline) error messages will cause other fields to be pushed to the end where they're harder to find.
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-1/+1
| | | | | | | | | | | | | | First, run ``` git grep -l "^edition =" | xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;' ``` Second, manually verify that all Cargo.toml files have changed, and nothing else has changed. Third, run cargo fmt again.
* Temporarily suppress mismatched_lifetime_syntaxes.Gabriela Moldovan2025-07-071-0/+1
| | | | See #2060.
* tor-error: Removed dependency on `once_cell`hashcatHitman2025-06-131-2/+1
| | | | | | - Replaced `once_cell::unsync::Lazy` with `std::cell::LazyCell`. Signed-off-by: hashcatHitman <[email protected]>
* *: use std::io::Error::other in many placesNick Mathewson2025-05-151-1/+1
| | | | | | | The `IoError::other` function is an easier way to say `IoError::new(IoErrorKind::Other, ...)`. It's been around since 1.74, but clippy started warning about the more verbose version in 1.87.
* netdoc: functionality for detecting missing subprotos.Nick Mathewson2025-04-161-0/+9
| | | | Also, add a new ErrorKind for this sort of error.
* tor-error: Implement ErrorReport for dyn StdError + 'static.Nick Mathewson2025-02-041-0/+6
| | | | This is needed to Report on the output of `StdError::source`.
* tor-error: Refor to the correct trait.Nick Mathewson2025-02-041-1/+1
|
* clippy: deny `mod_module_files`Steven Engler2025-01-061-0/+1
| | | | | | Denies 'mod.rs' files for consistency. https://rust-lang.github.io/rust-clippy/master/index.html#mod_module_files
* add_warnings, *: Allow clippy::needless_lifetimesNick Mathewson2024-12-031-0/+1
| | | | | | | | In 1.83, this warning triggers on many of our crates. We're thinking of fixing them all, but for now, we're going to disable the warning. This is part of #1765.
* tor-error: add comment to `ErrorKind::TransientFailure`Steven Engler2024-11-211-0/+1
|
* 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
|