@agentek/tools
Version:
Blockchain tools for AI agents
12 lines • 382 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.assertOkResponse = assertOkResponse;
/**
* Throws an error if the fetch response is not OK.
*/
async function assertOkResponse(response, context) {
if (!response.ok) {
throw new Error(`${context}: ${response.status} ${response.statusText}`);
}
}
//# sourceMappingURL=fetch.js.map