Skip to content

Commit

Permalink
fix: Added a simple localized error
Browse files Browse the repository at this point in the history
  • Loading branch information
vanlooverenkoen committed Feb 18, 2024
1 parent ea53618 commit 18dd0ee
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 0.0.3

# Feat

- SimpleLocalizedError

# 0.0.2

# Feat
Expand Down
11 changes: 11 additions & 0 deletions lib/src/model/data/error/localized_error.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,14 @@ abstract class BaseLocalizedError<Localization> extends Error
@override
String? getTranslatedError(Localization localization) => null;
}

class SimpleLocalizedError extends Error implements BaseLocalizedError<void> {
final String message;

SimpleLocalizedError(this.message);
@override
String get errorLocalizationKey => message;

@override
String? getTranslatedError(void localization) => message;
}

0 comments on commit 18dd0ee

Please sign in to comment.