diff --git a/src/app/components/submit-form/index.tsx b/src/app/components/submit-form/index.tsx index e55a0ee..f650a8a 100644 --- a/src/app/components/submit-form/index.tsx +++ b/src/app/components/submit-form/index.tsx @@ -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; } diff --git a/src/lib/qr-codes.ts b/src/lib/qr-codes.ts index bcb8802..cc376e7 100644 --- a/src/lib/qr-codes.ts +++ b/src/lib/qr-codes.ts @@ -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"); } }