66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
# File 'lib/simple_a2a/json_rpc.rb', line 66
def self.classify(error)
case error
when TaskNotFoundError then [ErrorCode::TASK_NOT_FOUND, error.message || "Task not found"]
when TaskNotCancelableError then [ErrorCode::TASK_NOT_CANCELABLE, error.message || "Task not cancelable"]
when PushNotificationNotSupportedError then [ErrorCode::PUSH_NOT_SUPPORTED, error.message || "Push notifications not supported"]
when UnsupportedOperationError then [ErrorCode::UNSUPPORTED_OPERATION, error.message || "Unsupported operation"]
when ContentTypeNotSupportedError then [ErrorCode::CONTENT_TYPE_NOT_SUPPORTED, error.message || "Content type not supported"]
when InvalidAgentResponseError then [ErrorCode::INVALID_AGENT_RESPONSE, error.message || "Invalid agent response"]
when ExtensionSupportRequiredError then [ErrorCode::EXTENSION_REQUIRED, error.message || "Extension required"]
when VersionNotSupportedError then [ErrorCode::VERSION_NOT_SUPPORTED, error.message || "Version not supported"]
when ParseError then [ErrorCode::PARSE_ERROR, error.message || "Parse error"]
when InvalidRequestError then [ErrorCode::INVALID_REQUEST, error.message || "Invalid request"]
when InvalidParamsError then [ErrorCode::INVALID_PARAMS, error.message || "Invalid params"]
else [ErrorCode::INTERNAL_ERROR, error.message || "Internal error"]
end
end
|