const require_errors = require('./errors-Bmqdg5Q6.cjs');

//#region src/internal/tool-helpers/enhance-error.ts
/**
* Enhances a 404 error with parameter context to help users understand what went wrong.
* This is optional - tools can use this when they want to provide extra context.
*
* @example
* ```typescript
* try {
*   const issue = await apiService.getIssue({ organizationSlug, issueId });
* } catch (error) {
*   if (error instanceof ApiNotFoundError) {
*     throw enhanceNotFoundError(error, { organizationSlug, issueId });
*   }
*   throw error;
* }
* ```
*/
function enhanceNotFoundError(error, params) {
	const paramsList = [];
	for (const [key, value] of Object.entries(params)) if (value !== void 0 && value !== null && value !== "") paramsList.push(`${key}: '${value}'`);
	if (paramsList.length > 0) {
		const enhancedMessage = `${error.message}\nPlease verify these parameters are correct:\n${paramsList.map((p) => `  - ${p}`).join("\n")}`;
		return new require_errors.ApiNotFoundError(enhancedMessage, error.detail, error.responseBody);
	}
	return error;
}

//#endregion
Object.defineProperty(exports, 'enhanceNotFoundError', {
  enumerable: true,
  get: function () {
    return enhanceNotFoundError;
  }
});
//# sourceMappingURL=enhance-error-DzXrKg85.cjs.map