Interface McpErrorExceptionMapper<T extends Throwable>

Type Parameters:
T - Exception to Map

public interface McpErrorExceptionMapper<T extends Throwable>
ApI to define mappers from exceptions to McpError.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canMap(Class<? extends Throwable> clazz)
     
    io.modelcontextprotocol.spec.McpError
    map(T exception)
    Map the given exception to a McpError.
  • Method Details

    • canMap

      boolean canMap(Class<? extends Throwable> clazz)
      Parameters:
      clazz - Exception class
      Returns:
      Whether the mapper can map the exception
    • map

      io.modelcontextprotocol.spec.McpError map(T exception)
      Map the given exception to a McpError.
      Parameters:
      exception - The exception to map
      Returns:
      an Mcp Error