Skip to content
Snippets Groups Projects

Clean up some errors in tor-dirmgr

Merged Nick Mathewson requested to merge nickm/arti:dirmgr_error_cleanup into main
1 unresolved thread

This branch cleans up some error messages and types in tor-dirmgr to be more informative.

I'm marking this as Draft because we shouldn't merge it before resolving #521 (closed) and putting out a tor-dirmgr patch release.

There are a couple of bigger refactorings that I am not doing right now:

  • Including full DocSource information in every error that comes from a document.
  • Describing what kind of a document we were trying to get in every applicable error.
  • Separating the errors that apply only to a single bootstrap-driven operation from those that refer to an API-level call.

I think those would all be fine down the line, but they make more sense after other planned dirmgr refactoring like #433.

Edited by Nick Mathewson

Merge request reports

Approved by

Merged by Nick MathewsonNick Mathewson 2 years ago (Jul 18, 2022 2:40pm UTC)

Merge details

  • Changes merged into main with 8d66f8ec.
  • Deleted the source branch.
  • Auto-merge enabled

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
92 93 }
93 94 }
94 95
95 let mut lockfile = fslock::LockFile::open(&lockpath)?;
96 if !readonly && !lockfile.try_lock()? {
96 let mut lockfile =
97 fslock::LockFile::open(&lockpath).map_err(|e| Error::LockFile(Arc::new(e)))?;
  • This LGTM. I would be happy to merge it as-is, but I had one small suggestion which you might like to do as part of this MR.

  • Nick Mathewson added 1 commit

    added 1 commit

    • 3c424c82 - dirmgr: Add a helper to create LockFile errors.

    Compare with previous version

  • Seems reasonable; applied the suggestion and marking for merge.

  • Nick Mathewson enabled an automatic merge when the pipeline for 3c424c82 succeeds

    enabled an automatic merge when the pipeline for 3c424c82 succeeds

  • Nick Mathewson mentioned in commit 8d66f8ec

    mentioned in commit 8d66f8ec

  • Please register or sign in to reply
    Loading