Skip to content

Poco::DateTime uses assertions for validation #1540

@kimgr

Description

@kimgr

We're unit-testing some code based on Poco::DateTime.

When we throw invalid dates at our code, this is printed to the console:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Assertion violation: month >= 1 && month <= 12 [in file "src/DateTime.cpp", line 67]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

It turns out because DateTime uses poco_assert for validation, there doesn't seem to be a clean way to validate date times without double-checking them.

Would you consider patches to throw a documented exception type instead? Any ideas on which type is preferable? Just a Poco::Exception?

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions