feat: unified error type (#308)

* feat: unified error type

* fix: use type id to compare transport type
This commit is contained in:
4t145 2025-07-09 11:23:39 +08:00 • committed by GitHub
commit e615300fea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -55,10 +55,13 @@ impl MyServer {
}
}
#[tool]
pub async fn some_progress(meta: Meta, client: Peer<RoleServer>) -> Result<(), rmcp::Error> {
pub async fn some_progress(
meta: Meta,
client: Peer<RoleServer>,
) -> Result<(), rmcp::ErrorData> {
let progress_token = meta
.get_progress_token()
.ok_or(rmcp::Error::invalid_params(
.ok_or(rmcp::ErrorData::invalid_params(
"Progress token is required for this tool",
None,
))?;