Skip to content
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

In AcmeIssuingService panic or call a dedicated callback on registration errors #145

Open
adiroiban opened this issue Nov 2, 2018 · 1 comment

Comments

@adiroiban
Copy link
Member

adiroiban commented Nov 2, 2018

When the service starts and fails to register the client, instead of just logging an error I would like to have something called so that I can either stop the service or try to recover.

I don't see much point in continuing to schedule a new certificate cert.

I think that this can be linked to #86 and I hope with a future feature in which you can use the service with an already registered account.

On the same idea, instead of log.failure(u'Error in scheduled certificate check.', failure) I would like to have some custom code called.

Yes... I can hook into the log system and do something, but I feel that this is not robust as I will have to do text matching.

As a general design, instead of calling panic with the raw failure, I would prefer to have AcmeIssuingService calling panic on any error, but with dedicated exceptions.

AcmeIssuingService could call panic with the following new exceptions:

  • ExpringRenewError('Raised when failing to renew a cert which is about to expire')
  • PanicRenewError('Raised when failing to renew a cert which is expired') - can have a better name ... maybe ExpiredRenewError
  • RegisterError('Raised when registration fails')
  • other errors for specific cases.

Also, if registation fails, one might not want to start the service.

For example, txacme raises acme.errors.UnexpectedUpdate in multipe places but there is not much documentation for this error... the docstring sais it all :)

class UnexpectedUpdate(ClientError):
    """Unexpected update error."""
@adiroiban
Copy link
Member Author

adiroiban commented Feb 28, 2020

For me it would be great if txacme.service.AcmeIssuingService.startService would return a deferred which is fired when the registration is done... or when it fails.

Or maybe just another txacme.service.AcmeIssuingService.start which is similar to startService but returns the deferred.

In this way I can tell that something is very wrong and there is no point to keep the service running.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant