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

Return Decanter Exception when there are formatting errors in :date parser #129

Open
DavidCorrea opened this issue Jun 22, 2022 · 1 comment · May be fixed by #133
Open

Return Decanter Exception when there are formatting errors in :date parser #129

DavidCorrea opened this issue Jun 22, 2022 · 1 comment · May be fixed by #133
Assignees

Comments

@DavidCorrea
Copy link

Feature Description

Given that Decanter is mostly used in controllers, I think it would be a nice idea that an exception that could be raised when a bad date is passed, raises a custom Decanter Exception instead of Date::Error. I think it will help with:

  1. If In the future there are more parsers with format options, all the possible errors could be represented in the same exception
  2. Given the previous point, handling formatting errors could be simplify by handling the custom exception and not having to handle each specific case.

Suggested Solution

Probably instead of simply returning Date::Error, we could return Decanter::ValueFormatError or something similar.

@chawes13
Copy link
Contributor

I think we could accommodate this. Would you like this to be assigned to you?

@oroth8 oroth8 linked a pull request Aug 24, 2022 that will close this issue
2 tasks
@oroth8 oroth8 linked a pull request Aug 24, 2022 that will close this issue
2 tasks
@oroth8 oroth8 self-assigned this Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants