Creating a Failure
Let's create a couple of Failure objects that describes the possible errors of the note feature.
Make sure that the Failure
objects extend the base Failure
class of the codenic_exception_converter package. Later, this will give us access to utility tools for conveniently converting Exceptions
into Failures
.
Under the note_app/modules/domain/lib/note/failures/
directory, create the following Failure
objects:
1. Create a Failure indicating that the note title has exceeded the max length
Make a file named note_title_too_long_failure.dart
and add the following code:
2. Create a Failure indicating that the note content has exceeded the max length
Make a file named and note_content_too_long_failure.dart
add the following code:
Last updated