Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Native client hides errors #64

Open
ruslandoga opened this issue Jun 16, 2024 · 1 comment
Open

Native client hides errors #64

ruslandoga opened this issue Jun 16, 2024 · 1 comment

Comments

@ruslandoga
Copy link
Contributor

ruslandoga commented Jun 16, 2024

👋

Right now if an error happens with the native client that error is not shown sometimes:

plausible-1 | 08:39:43.256 [error] Task #PID<0.4586.0> started from #PID<0.4369.0> terminating
plausible-1 | ** (MatchError) no match of right hand side value: {:error, #SiteEncrypt.Acme.Client.API.Session<https://acme-staging-v02.api.letsencrypt.org/directory>}
plausible-1 |     (site_encrypt 0.6.0) lib/site_encrypt/acme/client.ex:74: SiteEncrypt.Acme.Client.process_new_order/3
plausible-1 |     (site_encrypt 0.6.0) lib/site_encrypt/acme/client.ex:45: SiteEncrypt.Acme.Client.create_certificate/2
plausible-1 |     (site_encrypt 0.6.0) lib/site_encrypt/certification/native.ex:52: SiteEncrypt.Certification.Native.create_certificate/2
plausible-1 |     (site_encrypt 0.6.0) lib/site_encrypt/certification/job.ex:15: SiteEncrypt.Certification.Job.certify/1

Thoughts on raising instead of returning an error tuple and causing a MatchError?

@sasa1977
Copy link
Owner

The error info here is definitely not useful, but the problem is that it's not completely clear which error to return here. This is a call to the internal poll function which polls the server until it gets the successful result. If this doesn't happen after awhile, it gives up. So the error wouldn't give you much clues, because the error is basically, we didn't get success in the given time. We could perhaps collect all errors, and then somehow hand it off to the app code, though I'm not exactly sure how would I do that. Perhaps introducing some callback for reporting errors.

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

No branches or pull requests

2 participants