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

Some love to error handling. #74

Merged
merged 2 commits into from
Jan 20, 2023

Conversation

hugopl
Copy link
Collaborator

@hugopl hugopl commented Jan 18, 2023

  • Silent emit nil and do not raise IndexError on array out of bounds errors (like shopify liquid).
  • Only raise exceptions under LiquidException hierarchy.
  • Store exceptions instead of strings on Context#errors, so we can later add mode info on exception objects.
  • Do not raise exceptions on undefined variables, even on Strict mode (like shopify liquid).
  • Render the filter error on FilterArgumentException instead of raising (like shopify liquid), but raises on Strict mode, unlike Shopify liquid that does it only if rendering with render!
  • Fix some filters raising LiquidException instead of FilterArgumentException.
  • Add some documentation.

- Silent emit nil and do not raise `IndexError` on array out of bounds errors (like shopify liquid).
- Only raise exceptions under `LiquidException` hierarchy.
- Store exceptions instead of strings on `Context#errors`, so we can later add mode info on exception objects.
- Do not raise exceptions on undefined variables, even on Strict mode (like shopify liquid).
- Render the filter error on `FilterArgumentException` instead of raising (like shopify liquid), but raises
  on Strict mode, unlike Shopify liquid that does it only if rendering with `render!`
- Fix some filters raising `LiquidException` instead of `FilterArgumentException`.
- Add some documentation.
@hugopl hugopl requested a review from crimson-knight January 18, 2023 20:32
@crimson-knight crimson-knight merged commit 3f5c3f1 into amberframework:master Jan 20, 2023
@hugopl hugopl deleted the error-handling branch January 23, 2023 14:40
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants