Skip to content
This repository was archived by the owner on Feb 3, 2025. It is now read-only.

Commit d96b827

Browse files
Handle incorrect MutinyError::other message
1 parent 19be268 commit d96b827

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

mutiny-wasm/src/error.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,12 @@ impl From<MutinyError> for MutinyJsError {
211211
MutinyError::SamePassword => MutinyJsError::SamePassword,
212212
MutinyError::Other(e) => {
213213
error!("Got unhandled error: {e}");
214-
MutinyJsError::UnknownError
214+
// FIXME: For some unknown reason, InsufficientBalance is being returned as `Other`
215+
if e.to_string().starts_with("Insufficient balance") {
216+
MutinyJsError::InsufficientBalance
217+
} else {
218+
MutinyJsError::UnknownError
219+
}
215220
}
216221
MutinyError::SubscriptionClientNotConfigured => {
217222
MutinyJsError::SubscriptionClientNotConfigured

0 commit comments

Comments
 (0)