Skip to main content
Glama
unit-handleCoreOperationError.test.jsβ€’975 B
// ESM test: node scripts/debug/unit-handleCoreOperationError.test.mjs const mod = await import('../../dist/utils/axios-error-mapper.js'); const handleCoreOperationError = mod.handleCoreOperationError ?? mod.default?.handleCoreOperationError ?? mod.default; // Mock an Attio 400 invalid select option error const axiosErr = { response: { status: 400, data: { code: 'value_not_found', message: 'Cannot find select option with title "Med Spa Show 2025".', }, }, }; try { await handleCoreOperationError(axiosErr, 'update', 'companies', { trade_show_event_name: 'Med Spa Show 2025', }); console.error('❌ Expected a thrown structured error'); process.exit(1); } catch (e) { if ( e && typeof e.status === 'number' && e.body?.message?.includes('Invalid option') ) { console.log('βœ… Unit pass:', e.body.message); process.exit(0); } else { console.error('❌ Unit fail:', e); process.exit(1); } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kesslerio/attio-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server