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

Signalling encode errors #40

Open
reynir opened this issue Sep 25, 2023 · 0 comments
Open

Signalling encode errors #40

reynir opened this issue Sep 25, 2023 · 0 comments

Comments

@reynir
Copy link
Contributor

reynir commented Sep 25, 2023

Currently none of the terms in Asn.S will error when encoding. For the string types and utc_time the input is assumed to be valid when encoding (see also #39 for previous discussion). In #39 I proposed signalling an error when encoding a Ptime.t as utc_time outside the valid range.

It may make sense to define an exception in asn1-combinators for signalling encode errors rather than using ad hoc exceptions.

In albatross an error, although unlikely, is signalled with a Failure _ exception: https://github.com/robur-coop/albatross/blob/2f316d2e49866fe08b9e12c12194062bbbaa2329/src/vmm_asn.ml#L384-L402

Otherwise I have not found other occurrences of signalling errors when encoding from a brief survey.

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

No branches or pull requests

1 participant