| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
See #2060.
|
| |
|
|
|
|
| |
- Replaced `once_cell::unsync::Lazy` with `std::cell::LazyCell`.
Signed-off-by: hashcatHitman <[email protected]>
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
| |
Also, add a new ErrorKind for this sort of error.
|
| |
|
|
| |
This is needed to Report on the output of `StdError::source`.
|
| | |
|
| |
|
|
|
|
| |
Denies 'mod.rs' files for consistency.
https://rust-lang.github.io/rust-clippy/master/index.html#mod_module_files
|
| |
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
...
```
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.)
|
| |
|
|
|
|
| |
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.
|
| |\
| |
| |
| |
| | |
Add some more miri tests
See merge request tpo/core/arti!2502
|
| | | |
|
| |/
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
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.
|
| |\
| |
| |
| |
| | |
RPC: Method to expose a list of RPC methods.
See merge request tpo/core/arti!2332
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
`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.
|
| |/
|
|
|
| |
Removes resolve_backtraces from rtmock since it is no longer needed as
stdlib's backtraces automatically lazily resolve without needing a &mut.
|
| | |
|
| |
|
|
|
| |
We've wanted separate error codes for "no such method exists" and
"this method exists, but this object doesn't have it."
|
| |
|
|
| |
This commit is automatically generated.
|
| | |
|
| | |
|
| |
|
|
| |
Found by "git grep adhoc" and manual inspection.
|
| | |
|
| | |
|
| |
|
|
|
| |
Prompted by clippy complaining that the content wasn't ever read other
than by the autogenerated Debug impl.
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
This will let us impl for dyn StdError.
|
| |
|
|
|
| |
This impl can only compile for Self: Sized. This will let us remove
the Sized bound from the trait itself.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
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 ...
|
| |
|
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
| |
Possibly at some point in the past, matching a slice directly wasn't
possible. But it is now.
|
| | |
|
| |
|
|
|
|
|
|
| |
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
|
| | |
|
| |
|
|
|
| |
This code came from tor-error. So now tor-error depends on
retry-error.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |\
| |
| |
| |
| | |
Optional tracing support in tor-error for error reporting
See merge request tpo/core/arti!1379
|