-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: improve resilience of the parser #6
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
no more errors on EOFS handle attr
the goal was to allow * EOF to be interpeted as a valid headline.this one was involved so i'll provide some details: 1. extract title parsing to an external function so we can freely error in case a title isnt provided 2. never panic on EOF, this was happening in two places 3. make the tests actually.. test add make_node_id method for testing
nothing breaking, i just updated the formatting a while ago and never got around to resolving the errors it introduced in the tests
include and macro handling in the export error now expose real errors, not just yolo panicking and unwraps.
no longer unwraps, instead passes the error on screen also clean them up a bit for presentation
go right up to the end
Deploying org-rust with Cloudflare Pages
|
no longer stops after just one. also update org-wasm/org-cli to report these to the user. had to update the tests since there isnt a clean way to call =?= on a vec of items, so they all return nothing (and unwrap) instead of Result<()>. probably cleaner this way anyways
since we now coalesce errors and don't use the ? syntax, the only other source of those were in write!() calls. we almost exclusively write! to in memory string buffers (or maybe stdout), so I expect write! to never fail (at least not without the entire program catastrophically failing right alongside it) aside: I guess someone could pass in some network thing as a buffer where failure is more likely but it's not like we're recovering from a failure anyways. all that being said, I decided to use unwrap to just have the program explode if write! fails. it's more appropriate than failing silently since clearly something disastrous has happened and a panic would be what I want in that scenario. it feels icky to cause a panic but I think it's what a programmer would want in that scenario (and it'll almost never happen)
hydrobeam
force-pushed
the
resillience
branch
from
November 26, 2024 18:43
3ac8e91
to
8749786
Compare
✅ Deploy Preview ready!
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Goal
Make it so that
org-rust
never panics and instead does what it's supposed to do / provide a reasonable user-facing error.A lot of these cases were due to improper EOF handling in the parser, but there were other more general errors that should not have been happening.
contents
The commits describe the changes.
tldr: A lot of bug fixes and more tests to make sure these issues don't happen again