Skip to main content
Glama
bobmaertz

Bitbucket MCP Server

by bobmaertz
errors.ts1.7 kB
/** * Base error class for Bitbucket API errors */ export class BitbucketError extends Error { constructor( message: string, public statusCode?: number, public response?: unknown ) { super(message); this.name = 'BitbucketError'; Object.setPrototypeOf(this, BitbucketError.prototype); } } /** * Authentication error */ export class AuthenticationError extends BitbucketError { constructor(message: string = 'Authentication failed') { super(message, 401); this.name = 'AuthenticationError'; Object.setPrototypeOf(this, AuthenticationError.prototype); } } /** * Resource not found error */ export class NotFoundError extends BitbucketError { constructor(resource: string) { super(`Resource not found: ${resource}`, 404); this.name = 'NotFoundError'; Object.setPrototypeOf(this, NotFoundError.prototype); } } /** * Rate limit exceeded error */ export class RateLimitError extends BitbucketError { constructor( message: string = 'Rate limit exceeded', public retryAfter?: number ) { super(message, 429); this.name = 'RateLimitError'; Object.setPrototypeOf(this, RateLimitError.prototype); } } /** * Validation error */ export class ValidationError extends BitbucketError { constructor(message: string) { super(message, 400); this.name = 'ValidationError'; Object.setPrototypeOf(this, ValidationError.prototype); } } /** * Permission denied error */ export class PermissionError extends BitbucketError { constructor(message: string = 'Permission denied') { super(message, 403); this.name = 'PermissionError'; Object.setPrototypeOf(this, PermissionError.prototype); } }

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/bobmaertz/bitbucket-mcp'

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