summaryrefslogtreecommitdiff
path: root/crates/tor-error/src
Commit message (Collapse)AuthorAgeFilesLines
* 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
| * New ErrorKind for invalid onion addressesNick Mathewson2023-06-221-0/+9
| | | | | | | | Use this to emit HS_BAD_ADDRESS as appropriate.
| * Remove ErrorKind::OnionService{Intro,Rend}FailedNick Mathewson2023-06-221-19/+0
| | | | | | | | | | These errors are orthogonal to our actual error kinds. See discussion on #736.
* | Merge branch 'stderr' into 'main'Alexander Færøy2023-06-211-0/+2
|\ \ | |/ |/| | | | | lints: Promote clippy::print_stderr and clippy::print_stdout See merge request tpo/core/arti!1271
| * lints: Run maint/add_warning to actually apply new lintsIan Jackson2023-06-211-0/+2
| |
* | Add and use ErrorKinds for remaining onion service errorsNick Mathewson2023-06-211-0/+36
|/
* tor-error: Introduce `LooseCmpRetryTime`Ian Jackson2023-06-151-0/+19
| | | | | Having a newtype for this kind of thing is considerably more convenient. I'm going to use this in a moment.
* tor-hsclient: Conduct the INTRODUCE1 exchangeIan Jackson2023-06-131-0/+10
|