Skip to main content
Glama
error_handler_cm.js868 B
/** * @NApiVersion 2.1 * Custom Error Handler Base Class */ define(['N/log', 'N/runtime'], (log, runtime) => { class ErrorHandler { constructor() { this.scriptId = runtime.getCurrentScript().id; } wrapExecution(functionName, fn, context = {}) { try { log.debug({ title: `${functionName} - Start`, details: context }); const result = fn(); log.audit({ title: `${functionName} - Complete`, details: { success: true } }); return result; } catch (error) { log.error({ title: `${functionName} - Error`, details: { error: error.message, stack: error.stack, context } }); throw error; } } loadModule(moduleName) { return require(moduleName); } } return ErrorHandler; });

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/saralegui-solutions/mcp-self-learning-server'

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