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

Abort formatting exception #375

Closed
wants to merge 5 commits into from

Conversation

karljj1
Copy link
Collaborator

@karljj1 karljj1 commented Feb 16, 2024

This solution addresses the issue I outlined in the GitHub discussion (#373). In scenarios where the data from a custom source may be invalid, it becomes necessary to prevent continued processing of the string, and halt any further sources, and formatters without necessarily generating an error. This is particularly useful when dealing with optional sources that may not always be used or ready yet.

This adds an exception named AbortFormattingException. When this exception is encountered during the processing of the string, it serves as a signal to cease any further processing. Additionally, the exception can optionally include text that will be inserted instead of proceeding with the regular formatting.

Copy link

codecov bot commented Feb 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (245d3b0) 96% compared to head (1852f57) 96%.

Additional details and impacted files
@@         Coverage Diff         @@
##           main   #375   +/-   ##
===================================
  Coverage    96%    96%           
===================================
  Files        92     93    +1     
  Lines      3233   3241    +8     
===================================
+ Hits       3117   3125    +8     
  Misses      116    116           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@karljj1 karljj1 closed this Feb 19, 2024
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

Successfully merging this pull request may close these issues.

1 participant