chore(mcp): Handle all Backstage errors, both built-in and custom
Hey, I just made a Pull Request!
Follow up PR to https://github.com/backstage/backstage/pull/31847
This PR updates handleErrors.ts in mcp-actions-backend to handle any custom Backstage error, rather than just the built-in errors in @backstage/errors. This will be useful for any MCP tools that interact with plugins / custom integrations that have their own error set outside of the standard errors provided.
I've also added a couple basic test cases to cover the logic in handleErrors.ts
:heavy_check_mark: Checklist
[!IMPORTANT] This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior.
Changed Packages
| Package Name | Package Path | Changeset Bump | Current Version |
|---|---|---|---|
| @backstage/errors | packages/errors | minor | v1.2.7 |
| @backstage/plugin-mcp-actions-backend | plugins/mcp-actions-backend | patch | v0.1.6-next.1 |
Example of custom error being thrown in an MCP action: