fix: showing errors when converting qr code
This commit is contained in:
parent
5eab64ef96
commit
38356cf2f9
2 changed files with 3 additions and 2 deletions
|
|
@ -101,7 +101,7 @@ export default function SubmitForm() {
|
|||
try {
|
||||
conversion = convertQrCode(qrBytes);
|
||||
} catch (error) {
|
||||
setError(error as string);
|
||||
setError(error instanceof Error ? error.message : String(error));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,8 @@ export function convertQrCode(bytes: Uint8Array): { mii: Mii; tomodachiLifeMii:
|
|||
}
|
||||
|
||||
return { mii, tomodachiLifeMii };
|
||||
} catch {
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
throw new Error("Mii data is not valid");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue