aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-error/src/internal.rs
Commit message (Collapse)AuthorAgeFilesLines
* tor-error: Fix clippy warningshjrgrn2026-07-101-1/+1
|
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-091-0/+1
| | | | | | | | | | | | This commit executes maint/add_warning with the just added change to deny string slices except in tests. I recommend auditing this by checking out the previous commit followed by running the script yourself and then verifying that the diff is identical to this commit. This commit makes cargo clippy fail. We will add exceptions in the next commit.
* Fix grammar typosTobias Stoeckmann2026-03-151-3/+3
|
* Fix word duplicate typosTobias Stoeckmann2026-03-151-1/+1
|
* 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.
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
| | | | Run maint/add_warning
* 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 ... ```
* tor-error: Disable backtraces under miri, even if cargo feature enabledIan Jackson2024-10-081-2/+2
|
* 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.
* Run maint/add_warning.Nick Mathewson2024-03-131-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.
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* 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-101-0/+1
|
* Add TODO comments about possibly migrating away from the backtrace crate.Nick Mathewson2023-07-051-0/+2
|
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-271-0/+1
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* tor-error: tests: Add a test case for Report and Bug wrappingIan Jackson2022-12-151-0/+11
|
* Allow "clippy::single_char_pattern" in tests.Ian Jackson2022-10-121-0/+1
| | | | | | | This lint exists for perf reasons, and this is rarely relevant in tests. Using double quoted str is generally cognitively less burdensome.
* tor-error::internal: Remove a redundant suppressionIan Jackson2022-09-301-1/+0
| | | | Spotted this in passing.
* force no inlining on internal_macro_testtrinity-1686a2022-09-091-0/+1
| | | | it may fix this test when running in release, where the function gets inlined, so its name does not appear in the backtrace
* Add a dbg!() to diagnose #570.Nick Mathewson2022-09-081-0/+9
| | | | | This won't fix anything, but it will let us see what the backtrace looks like when it fails.
* Placate rustfmtIan Jackson2022-05-171-5/+1
| | | | I found the previous layout *much* better. Ah well.
* Do backtrace string matching test only on some platforms.Ian Jackson2022-05-171-0/+19
| | | | | | "Fixes" #455 by suppressing the test. This is !509 redux.
* Revert "Merge branch 'backtrace' into 'main'"eta2022-05-161-6/+0
| | | This reverts merge request !509
* Do backtrace string matching test only on LinuxIan Jackson2022-05-161-0/+6
| | | | "Fixes" #455 by suppressing the test.
* tor_error::Bug: change Display impl to use kindIan Jackson2022-02-151-2/+2
| | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/310#note_2777626 The message from the kind is precisely right.
* Rename BadApiUsage from BadAPIUsageIan Jackson2022-02-151-4/+4
| | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/310#note_2777519 mutatis mutandi. And, fix a leftover instance with an old idea of what this was called.
* Make Bug from InternalError, add bad_api_usage! and into_bad_api_usage!Ian Jackson2022-02-151-34/+86
| | | | Including supporting machinery, new kind field, etc.
* tests for tor-error::internalNick Mathewson2022-02-041-1/+47
| | | | | | These tests turned up a need for using the #[track_caller] annotation in order to get accurate locations, which is fortunately stable since Rust 1.46.0.
* errors: Drop "Error" and "Failed" from various enum variantsIan Jackson2022-02-041-1/+1
|
* tor-error: provide into_internal!Ian Jackson2022-02-041-0/+33
|
* tor-error: Allow making an `InternalError` from some other errorIan Jackson2022-02-041-3/+27
| | | | | | | This can be used in call sites where an error is thought not to be possible. The `source` will be used only for formatting messages.
* tor-error: Introduce InternalError as a type and a kindIan Jackson2022-02-041-0/+134
This can contain a backtrace, which will be printed.