videosphere
    Preparing search index...

    Function youtubeUpstreamErrorResponse

    • Builds a 502 response for a failed YouTube Data API request. Auth credential failures are mapped to 401 so clients can prompt reconnect.

      Parameters

      • details: string

        Upstream error message or body text.

      • OptionalstatusCode: number

        HTTP status from the YouTube API response, when known.

      Returns NextResponse

      JSON error response for route handlers.