-
Notifications
You must be signed in to change notification settings - Fork 15
Refactor logging and error handling #60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors logging and error handling throughout the ACME certificate management system to provide better error messages, proper error categorization, and improved handling of rate limits and retry scenarios.
- Introduces structured error types to replace generic error handling
- Adds detailed logging for certificate operations and account management
- Implements proper rate limit handling with server-provided retry intervals
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
src/state/issuer.rs | Adds error state tracking and exponential backoff for issuer failures |
src/state/certificate.rs | Refactors certificate validity checking with separate is_valid() method |
src/lib.rs | Replaces generic error handling with structured error types and detailed logging |
src/conf/order.rs | Refactors order identification with new PrintableOrderId type |
src/conf/issuer.rs | Adds issuer-level error handling method |
src/acme/error.rs | Introduces comprehensive error type hierarchy for ACME operations |
src/acme.rs | Major refactoring of ACME client with structured error handling and improved logging |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
e3dffdb
to
b5a18a7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good for me.
3f46ef6
to
003a368
Compare
Example messages:
|
Also, prefer first available DNS name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise looks good.
003a368
to
5593251
Compare
Clean up error handling in the main update loop.
* Implement backoff for login errors * Log new account URLs
We already log the URL, but on INFO level and only once. And while it is possible to find the URL from private key, the operation is not trivial. Let's make this simpler by writing a file named "account.url" to the state directory whenever the issuer tells us it created a new account. Fixes nginx#54
Previously, it was possible to suspend the module execution by sending a sufficiently high Retry-After value. Now we will refuse to wait longer than one minute.
5593251
to
8dd01b0
Compare
We don't care about the error kind here, we just need to pass it to the caller and print. anyhow seems a bit too heavy for the task. While we're at it, remove unused futures-channel.
8dd01b0
to
527e7a7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
This has been slowly progressing since before the initial release, and while I'm not completely satisfied, it is time to publish something.
Fixes lots of issues with insufficient or just plain bad log messages, incorrect error reporting etc.
Also, fixes handling of rate limit errors and large Retry-After values.
I'm still planning to review and adjust the individual messages while testing this.