beberlei / assert

Thin assertion library for use in libraries and business-model
Other
2.41k stars 188 forks source link

Doubt LazyAssertion #241

Closed martinpfeiferdev closed 6 years ago

martinpfeiferdev commented 6 years ago

If in class LazyAssertion has 2 methods: hasErrors(): bool and getErrors(), would help too much.

rquadling commented 6 years ago

LazyAssertion::verifyNow() throws an exception with all the errors, so use a try/catch around that and you've got your errors. If LazyAssertion::verifyNow() returns true, then you have no errors.

The assertion library uses true or throws an Exception.