Skip to content

Commit

Permalink
Update MiniApp Error parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
rleojoseph committed Jan 30, 2024
1 parent 051727b commit f8cfd56
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion js-miniapp-bridge/src/types/error-types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,15 @@ function parseMiniAppError(jsonString: string): MiniAppError {
);
} catch (e) {
console.error(e);
if (jsonString !== "" || jsonString !== undefined) {
return new MiniAppError({
type: 'MiniAppError',
message: jsonString,
});
}
return new MiniAppError({
type: 'MiniAppError',
message: 'Failed to parse the error: ' + jsonString,
message: 'Failed to parse the error',
});
}
}
Expand Down

0 comments on commit f8cfd56

Please sign in to comment.