using ColaFlow.Modules.Mcp.Contracts.JsonRpc;

namespace ColaFlow.Modules.Mcp.Domain.Exceptions;

/// <summary>
/// Exception thrown when a requested resource is not found
/// Maps to JSON-RPC error code -32003 (NotFound)
/// HTTP 404 status code
/// </summary>
public class McpNotFoundException : McpException
{
    /// <summary>
    /// Initializes a new instance of the <see cref="McpNotFoundException"/> class
    /// </summary>
    /// <param name="resourceType">Type of resource (e.g., "Task", "Epic")</param>
    /// <param name="resourceId">ID of the resource</param>
    public McpNotFoundException(string resourceType, string resourceId)
        : base(JsonRpcErrorCode.NotFound, $"{resourceType} not found: {resourceId}")
    {
    }

    /// <summary>
    /// Initializes a new instance of the <see cref="McpNotFoundException"/> class with custom message
    /// </summary>
    /// <param name="message">Error message</param>
    /// <param name="errorData">Additional error data (optional)</param>
    public McpNotFoundException(string message, object? errorData = null)
        : base(JsonRpcErrorCode.NotFound, message, errorData)
    {
    }
}
