ModReleaser/src/lib/utils/fetch.ts

13 lines
347 B
TypeScript
Raw Normal View History

/**
* 4096
*
*/
export async function readErrorBody(res: Response): Promise<string> {
try {
const text = await res.text();
return text.slice(0, 4096);
} catch {
return "(unable to read response body)";
}
}