MCPcopy Index your code
hub / github.com/simstudioai/sim / parseBrexJson

Function parseBrexJson

apps/sim/tools/brex/utils.ts:17–30  ·  view source on GitHub ↗
(response: Response)

Source from the content-addressed store, hash-verified

15 * Parses a Brex API response body, throwing a descriptive error for non-2xx responses.
16 */
17export async function parseBrexJson(response: Response) {
18 if (!response.ok) {
19 const text = await response.text()
20 let message = text
21 try {
22 const parsed = JSON.parse(text)
23 message = parsed.message ?? text
24 } catch {
25 message = text
26 }
27 throw new Error(`Brex API error (${response.status}): ${message}`)
28 }
29 return response.json()
30}
31
32/**
33 * Appends a comma-separated value as repeated query parameters (Brex array syntax).

Callers 15

get_vendor.tsFile · 0.90
get_budget.tsFile · 0.90
get_transfer.tsFile · 0.90
get_user.tsFile · 0.90
list_budgets.tsFile · 0.90
get_company.tsFile · 0.90

Calls 2

textMethod · 0.80
parseMethod · 0.80

Tested by

no test coverage detected