getMessage static method

String getMessage(
  1. int code
)

Get error message for code

Implementation

static String getMessage(int code) {
  return switch (code) {
    parseError => 'Parse error',
    invalidRequest => 'Invalid request',
    methodNotFound => 'Method not found',
    invalidParams => 'Invalid params',
    internalError => 'Internal error',
    toolNotFound => 'Tool not found',
    resourceNotFound => 'Resource not found',
    promptNotFound => 'Prompt not found',
    cancelled => 'Operation cancelled',
    timeout => 'Operation timeout',
    permissionDenied => 'Permission denied',
    rateLimited => 'Rate limited',
    networkError => 'Network error',
    protocolError => 'Protocol error',
    _ => 'Unknown error',
  };
}