Skip to content

Commit

Permalink
fix vpk load error
Browse files Browse the repository at this point in the history
  • Loading branch information
barnabwhy committed Jun 13, 2024
1 parent 8e76718 commit 7b29469
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/stores/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,17 @@ export const useStore = defineStore('main', () => {
loading.value = false;
loaded.value = false;
hasError.value = true;
error.value = JSON.parse(e);
switch (typeof e) {
case 'string':
error.value = e;
break;
case 'object':
error.value = JSON.stringify(e);
break;
default:
error.value = 'An unknown error occurred';
break;
}
}
}

Expand Down

0 comments on commit 7b29469

Please sign in to comment.