Skip to content

Commit

Permalink
fix: parse unknown error (#1729)
Browse files Browse the repository at this point in the history
Co-authored-by: Rémon <[email protected]>
  • Loading branch information
jamesblasco and remonh87 authored May 21, 2024
1 parent b12f899 commit 9343e71
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class LocalizedErrorMessage with _$LocalizedErrorMessage {
@JsonSerializable(explicitToJson: true)
const factory LocalizedErrorMessage({
/// The error code for example Cancelled
@JsonKey(unknownEnumValue: FailureCode.Unknown)
required FailureCode code,

/// Localized error message if any
Expand All @@ -73,7 +74,7 @@ class LocalizedErrorMessage with _$LocalizedErrorMessage {
_$LocalizedErrorMessageFromJson(json);
}

enum FailureCode { Failed, Canceled, Timeout }
enum FailureCode { Failed, Canceled, Timeout, Unknown }

class StripeConfigException implements Exception {
const StripeConfigException(this.message);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9343e71

Please sign in to comment.