Skip to content

MCP Server - Implement error handling #16654

Description

@linear

Right know, error handling is done manually by users, like so:

function handleError(err: unknown) {
  const eventId = Sentry.captureException(error);

  return [
    "**Error**",
    "There was an problem with your request.",
    "Please report the following to the user:",
    `**Event ID**: ${eventId}`,
    process.env.NODE_ENV !== "production"
      ? error instanceof Error
        ? error.message
        : String(error)
      : "",
  ].join("\n\n");
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

javascriptPull requests that update javascript code

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions