MCPcopy Create free account
hub / github.com/xerrors/Yuxi / parseErrorDetail

Function parseErrorDetail

web/src/apis/auth_api.js:7–17  ·  view source on GitHub ↗
(response, fallbackMessage)

Source from the content-addressed store, hash-verified

5import { apiAdminGet } from './base'
6
7async function parseErrorDetail(response, fallbackMessage) {
8 const contentType = response.headers.get('content-type') || ''
9
10 if (contentType.includes('application/json')) {
11 const error = await response.json()
12 return error?.detail || fallbackMessage
13 }
14
15 const text = (await response.text()).trim()
16 return text || fallbackMessage
17}
18
19/**
20 * 获取 OIDC 配置

Callers 2

getOIDCLoginUrlFunction · 0.85
exchangeOIDCCodeFunction · 0.85

Calls 2

jsonMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected