Skip to content

settingsGistIdの値が不正な場合、500エラーになる #15

@MH4GF

Description

@MH4GF

背景

問い合わせをいただいた

github-nippouでrunを押したらこういうエラーが出たのですが、どうしたら良いでしょうか:ぐる目顔:
github-nippou-web.vercel.app/:1
       Failed to load resource: the server responded with a status of 500 ()
786-3264ade908fd4734.js:1 Error: An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.
window.console.error

VercelのServer Componentのログ
サーバーから返却されるレスポンスがおかしいっぽい 👀

SyntaxError: Unexpected token I in JSON at position 0
    at JSON.parse (<anonymous>)
    at parseJSONFromBytes (node:internal/deps/undici/undici:6662:19)
    at successSteps (node:internal/deps/undici/undici:6636:27)
    at node:internal/deps/undici/undici:1236:60
    at node:internal/process/task_queues:140:7
    at AsyncResource.runInAsyncScope (node:async_hooks:203:9)
    at AsyncResource.runMicrotask (node:internal/process/task_queues:137:8)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

apiのログ
gistの取得にエラーが出ている 👀

Oct 20 04:04:33 PM  {"time":"2023-10-20T07:04:33.276316272Z","level":"ERROR","msg":"GET https://api.github.com/gists/@[問い合わせいただいた方のユーザー名]: 404 Not Found []"}

→ gistIdの入力フォームを空にしてRunを押してもらうと動いた

概要

gistの取得で404になった場合、適切なエラーメッセージを返したい

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions