Skip to content
Snippets Groups Projects
Verified Commit 3038f2a2 authored by Mateusz Tyszczak's avatar Mateusz Tyszczak :scroll:
Browse files

Improve error message handling

parent e5df7fff
No related branches found
No related tags found
No related merge requests found
Pipeline #117793 passed
......@@ -25,7 +25,7 @@
"vue-sonner": "^1.3.0"
},
"devDependencies": {
"@hiveio/wax": "1.27.6-rc7-250304235913",
"@hiveio/wax": "1.27.6-rc7-250314161617",
"@mdi/js": "^7.4.47",
"@metamask/providers": "^16.0.0",
"@tanstack/vue-table": "^8.21.2",
......
......@@ -13,8 +13,8 @@ importers:
version: 1.3.0
devDependencies:
'@hiveio/wax':
specifier: 1.27.6-rc7-250304235913
version: 1.27.6-rc7-250304235913
specifier: 1.27.6-rc7-250314161617
version: 1.27.6-rc7-250314161617
'@mdi/js':
specifier: ^7.4.47
version: 7.4.47
......@@ -284,12 +284,12 @@ packages:
'@floating-ui/vue@1.1.6':
resolution: {integrity: sha512-XFlUzGHGv12zbgHNk5FN2mUB7ROul3oG2ENdTpWdE+qMFxyNxWSRmsoyhiEnpmabNm6WnUvR1OvJfUfN4ojC1A==}
'@hiveio/beekeeper@1.27.9-stable.250219154236':
resolution: {integrity: sha1-6fL+OgTwp6MSp0Xm3fwj+kFLzD8=, tarball: https://gitlab.syncad.com/api/v4/projects/198/packages/npm/@hiveio/beekeeper/-/@hiveio/beekeeper-1.27.9-stable.250219154236.tgz}
'@hiveio/beekeeper@1.27.10-stable.250305202831':
resolution: {integrity: sha1-mPx0QrDh3NSPSOYGyR1SUyi3lyA=, tarball: https://gitlab.syncad.com/api/v4/projects/198/packages/npm/@hiveio/beekeeper/-/@hiveio/beekeeper-1.27.10-stable.250305202831.tgz}
engines: {node: ^20.11 || >= 21.2}
'@hiveio/wax@1.27.6-rc7-250304235913':
resolution: {integrity: sha1-Dk27ws/cbPd8P+aomJlGCzL98rI=, tarball: https://gitlab.syncad.com/api/v4/projects/419/packages/npm/@hiveio/wax/-/@hiveio/wax-1.27.6-rc7-250304235913.tgz}
'@hiveio/wax@1.27.6-rc7-250314161617':
resolution: {integrity: sha1-cFrsq3vl6M18v4dhbfYScUj00p0=, tarball: https://gitlab.syncad.com/api/v4/projects/419/packages/npm/@hiveio/wax/-/@hiveio/wax-1.27.6-rc7-250314161617.tgz}
engines: {node: ^20.11 || >= 21.2}
'@internationalized/date@3.7.0':
......@@ -1637,11 +1637,11 @@ snapshots:
- '@vue/composition-api'
- vue
'@hiveio/beekeeper@1.27.9-stable.250219154236': {}
'@hiveio/beekeeper@1.27.10-stable.250305202831': {}
'@hiveio/wax@1.27.6-rc7-250304235913':
'@hiveio/wax@1.27.6-rc7-250314161617':
dependencies:
'@hiveio/beekeeper': 1.27.9-stable.250219154236
'@hiveio/beekeeper': 1.27.10-stable.250305202831
events: 3.3.0
long: 5.3.1
......
......@@ -84,7 +84,7 @@ const encryptOrDecrypt = async () => {
<div class="flex mb-4 underline text-sm" v-if="isEncrypt">
<a @click="useMyMemoKey" class="ml-auto mr-1 cursor-pointer" style="color: hsla(var(--foreground) / 70%)">Use my memo key</a>
</div>
<Button :disabled="!hasWallet" @click="encryptOrDecrypt">{{ isEncrypt ? "Encrypt" : "Decrypt" }}</Button>
<Button :disabled="!hasWallet || (!encryptForKey && isEncrypt)" @click="encryptOrDecrypt">{{ isEncrypt ? "Encrypt" : "Decrypt" }}</Button>
<Textarea v-model="outputData" placeholder="Output" copy-enabled class="my-4" disabled/>
</CardContent>
</Card>
......
......@@ -70,7 +70,7 @@ const broadcast = async () => {
const tx = wax.createTransactionFromJson(inputData.value);
tx.sign(outputData.value);
wax.broadcast(tx);
await wax.broadcast(tx);
} catch (error) {
toastError('Error broadcasting transaction', error);
} finally {
......
......@@ -7,8 +7,14 @@ export const toastError = (title: string, error: unknown) => {
if (typeof error === "object" && error) {
if (error instanceof WaxError) {
if (error instanceof WaxChainApiError) {
if (error.apiError && typeof error.apiError === "object" && "message" in error.apiError && typeof error.apiError.message === "string")
description = error.apiError.message;
if (error.apiError
&& typeof error.apiError === "object"
&& "error" in error.apiError
&& typeof error.apiError.error === "object"
&& error.apiError.error
&& "message" in error.apiError.error
&& typeof error.apiError.error.message === "string")
description = error.apiError.error.message;
else
description = error.message;
} else {
......
......@@ -8,7 +8,7 @@
*/
export const defaultSnapOrigin = import.meta.env.VITE_SNAP_ORIGIN || `npm:@hiveio/metamask-snap`; // local:http://localhost:8080
export const defaultSnapVersion: string | undefined = import.meta.env.VITE_SNAP_VERSION ?? '1.3.2';
export const defaultSnapVersion: string | undefined = import.meta.env.VITE_SNAP_VERSION ?? '1.3.3';
/**
* Check if a snap ID is a local snap ID.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment