summaryrefslogtreecommitdiff
path: root/crates/arti-client/src/err.rs
Commit message (Collapse)AuthorAgeFilesLines
* ErrorHint: Add a note about lowering the permissions hintNick Mathewson2023-01-271-0/+4
|
* ErrorHint: use anonymize_homeNick Mathewson2023-01-271-2/+4
|
* ErrorHint: Implement tryfrom_torpersistNick Mathewson2023-01-271-2/+6
|
* ErrorHint: refactor API (part 2)Nick Mathewson2023-01-271-75/+60
| | | | | | | Change ErrorHint so that, internally, it just holds an enum with a lightweight reference to whatever parts of the error it needs to generate a hint. Then we can move the formatting logic into a Display function for ErrorHint, and do away with ErrorDetail entirely.
* ErrorHint: refactor API (part 1)Nick Mathewson2023-01-271-13/+19
| | | | | | | Move the "hint" function into Error, and use Option rather than Result. (I'm using Option here because it's not really an error case not to have a hint; we just either have a hint, or we don't.)
* add opaque ErrorHint API, impl ErrorHint from BadPermissionsShady Katy2023-01-271-0/+138
|
* 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.
* test lint blocks: Add many many automaticallyIan Jackson2022-12-121-0/+9
| | | | | This is precisely the result of running the rune in maint/adhoc-add-lint-blocks.
* arti-client: spelling fix.Nick Mathewson2022-12-061-1/+1
|
* Spelling fix in arti_client::erreta2022-11-291-1/+1
|
* PtMgr: Use a persistent state directory for PT state.Nick Mathewson2022-11-281-0/+5
| | | | | | | | | | This makes a `pt_state` directory inside .local/share/arti (or the local equivalent), right next to our existing `state` dir. Ideally we would use a separate directory for each PT, but we have a very fuzzy "what is a specific PT" notion. Closes #667
* Integrate PtMgr into arti-client.Nick Mathewson2022-11-281-0/+7
| | | | | | | | If support is available at compile-time, then we construct a PtMgr and register it with the ChanMgr. We keep a handle to it ourself so that we can reconfigure it as needed. Closes #659.
* bridges: Create and install a BridgeDescMgr when we bootstrapIan Jackson2022-11-151-0/+7
|
* Move GuardMgr::new call to arti_client::TorClientIan Jackson2022-11-141-0/+6
| | | | | | | Having this done within circmgr was irregular - most of our other key buildup functions are done in TorClient::create_inner. It is also inconvenient, as it buries the guardmgr within the circmgr.
* arti-client: Treat list of exit ports as sensitive.Nick Mathewson2022-08-251-1/+2
|
* add feature annotation not added by doc_auto_cfgtrinity-1686a2022-08-241-0/+1
|
* Several typo fixes from `typos`.Nick Mathewson2022-07-271-1/+1
|
* Update arti-client to new NetDirProvider API.Nick Mathewson2022-07-261-0/+12
| | | | | | This allows us to give better errors in the case where bootstrapping succeeds at first, but fails thereafter for long enough to make our directory expire.
* arti-client: Split "Persist" into setup and access variants.Nick Mathewson2022-07-211-3/+8
|
* arti_client: turn "Proto" error into StreamFailed.Nick Mathewson2022-07-211-3/+10
|
* arti_client: Split DirMgr error into useful types.Nick Mathewson2022-07-211-4/+10
|
* arti-client: minor edits in error messages and commentsNick Mathewson2022-07-211-17/+20
|
* arti-client: Add Bug variant to errorIan Jackson2022-07-181-0/+5
| | | | We're going to want this in a moment.
* Do not include error source() in display() format.Nick Mathewson2022-06-211-8/+8
| | | | | | | | | According to doc/Errors.md, and in keeping with current best practices, we should not include display an error's `source()` as part of that error's display method. Instead, we should let the caller decide to call source() and display that error in turn. Part of #323.
* Make daemon tasks self-contained; introduce NetDirProvidereta2022-03-301-0/+5
| | | | | | | | | | | | | | | The various background daemon tasks that `arti-client` used to spawn are now handled inside their respective crates instead, with functions provided to spawn them that return `TaskHandle`s. This required introducing a new trait, `NetDirProvider`, which steals some functionality from the `DirProvider` trait to enable `tor-circmgr` to depend on it (`tor-circmgr` is a dependency of `tor-dirmgr`, so it can't depend on `DirProvider` directly). While we're at it, we also make some of the tasks wait for events from the `NetDirProvider` instead of sleeping, slightly increasing efficiency.
* Merge branch 'dir-provider-redux' into 'main'Ian Jackson2022-03-021-0/+7
|\ | | | | | | | | Alternative DirProvider setup See merge request tpo/core/arti!347
| * Add a builder function for replacing a DirProvider.Nick Mathewson2022-02-231-0/+7
| | | | | | | | Put it behind experimental_api.
* | impl From<TorAddrError> for tor_error::ErrorIan Jackson2022-02-231-0/+8
|/ | | | | It auto-converts to ErrorDetail but add this for convenience of callers which don't want to look into that unstable API.
* Rename ExitTimeout to RemoteNetworkTimeout.Nick Mathewson2022-02-171-1/+1
|
* arti_client: provide Kinds for all errors.Nick Mathewson2022-02-161-1/+10
|
* Allow creating unbootstrapped `TorClient`s (and `DirMgr`s)eta2022-02-111-1/+10
| | | | | | | | | | | | | | | This commit changes how the `TorClient` type works, enabling it to be constructed synchronously without initiating the bootstrapping process. Daemon tasks are still started on construction (although some of them won't do anything if the client isn't bootstrapped). The old bootstrap() methods are now reimplemented in terms of the new create_unbootstrapped() and bootstrap_existing() methods. This required refactoring how the `DirMgr` works to enable the same sort of thing there. closes #293
* ErrorDetail Simplify visibility macros a bit.Nick Mathewson2022-02-081-12/+53
| | | | | | | | Instead of declaring a macro that takes vis as an argument, we now conditionally declare a macro that applies an appropriate visibility. There's a long comment explaining the rationale here, along with a couple of other solutions that don't work.
* Rename TorResult to Result.Nick Mathewson2022-02-081-12/+13
| | | | | | | This is closer to common usage. (Not that we all agree with common usage, but it's closer to what people expect.)
* arti_client: Rename Error to ErrorDetail.Nick Mathewson2022-02-081-18/+12
| | | | | | | This is closer to what we described in Errors.md. Also, remove the (sometimes private) Result alias: it was only used in one or two places, and never exposed in public.
* TorError: Make detail() an accessor function.Nick Mathewson2022-02-081-4/+25
| | | | | | This change lets us make TorError's members unconditionally hidden, and makes our API a little more consistent (since basically nothing else is a public field).
* Docs and clarification for a bunch of Error stuffNick Mathewson2022-02-041-4/+27
|
* Make SpawnError wrappers contain a 'spawning' stringNick Mathewson2022-02-041-8/+18
| | | | | (By our convention, these errors should say what we were trying to spawn when the error occurred.)
* Make the Error detail type non-exported from arti-clientNick Mathewson2022-02-041-17/+5
| | | | | | | | | | | At least by default, we should have Error be private, and not expose it as part of our APIs. To keep functionality in `arti`, I had to add an `ExitTimeout` error kind. For interface consistency, I also re-exported ErrorKind and HasError from `arti_client`.
* Test that TorError implements the right traits.Nick Mathewson2022-02-041-3/+21
| | | | | I had planned to use assert_impl, but that can't check for the 'static lifetime.
* Make TorError implement Clone.Nick Mathewson2022-02-041-3/+2
| | | | | This patch makes only minimal changes in lower-level error types: we have more refactoring to do.
* errors: Add some TODOs as per discussion commentsIan Jackson2022-02-041-0/+3
|
* errors: Drop "Error" and "Failed" from various enum variantsIan Jackson2022-02-041-2/+2
|
* Box the Error in a TorErrorIan Jackson2022-02-041-2/+10
| | | | | | This will get quite large and boxing it here is very convenient. This also avoids us exposing a large error type to our callers.
* errors: Handle exit circuit creation failure the new wayIan Jackson2022-02-041-1/+18
|
* errors: Handle circmgr setup errors differentlyIan Jackson2022-02-041-3/+3
| | | | | | | | | | | | | The motivation for doing this now is to remove the `#[from]` so we would spot where operationsl circuit setup failures were handled. (But it turns out that they are turned into internal errors!) Perhaps this will want to become a different error type from circmgr in due course, but for now we simply use a bespoke variant of TorError. It will want its own Kind. The TODO in the HasKind impl marks this (amongst much else here).
* errors: Introduce error_detail featureIan Jackson2022-02-041-2/+18
| | | | | Right now we must always expose the `Error` type since we haven't converted everything.
* errors: Refer to err::Error in some bits of arti_clientIan Jackson2022-02-041-0/+3
| | | | We are going to make the top-level Error type conditionally hidden.
* errors: Introduce TorErrorIan Jackson2022-02-041-1/+28
| | | | Still much to do here.
* errors: Initial impl HasKind in arti-client, ErrorKind::TODOIan Jackson2022-02-041-0/+7
| | | | | | | | | This involves making a temporary ErrorKind::TODO. That will continue to exist until all errors (at least, the ones that make it out to here) can be properly categorised. Introducing this will let us work from the top and bottom towards the middle.
* spawn errors: Fix arti-client, tor-chanmgr, tor-circmgrIan Jackson2022-02-041-3/+10
| | | | | | | Provide an enum variant to contain the SpawnError and a From impl. We use `#[from]` here because it doesn't really make sense to attach any context, as it's not likely to be very relevant.