2
0
Files
bot/packages/forge/blocks/nocodb/helpers/parseErrorResponse.ts
Baptiste Arnaud 0f2f4d2130 🚸 (nocodb) Clean up error messages
Closes #1568
2024-06-14 10:05:16 +02:00

10 lines
248 B
TypeScript

export const parseErrorResponse = async (res: Response) => {
if (res.headers.get('content-type')?.includes('application/json')) {
const json = await res.json()
if ('msg' in json) return json.msg
return json
}
return res.text()
}