Skip to content

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

@DavidCorrea

Description

@DavidCorrea

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions