feat: standardize resource-not-found error code (SEP-2164) (#899)

* feat: implement SEP-2164 resource not found errors

* test: update protocol version utility expectations

* feat: gate not-found code at server boundary

---------

Co-authored-by: Michael Neale <michael.neale@gmail.com>
This commit is contained in:
Dale Seo 2026-06-16 21:55:25 -04:00 • committed by GitHub
commit 95a8e961e0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -672,6 +672,16 @@ impl<R: ServiceRole> RequestContext<R> {
}
}
#[cfg(feature = "server")]
impl RequestContext<RoleServer> {
/// The protocol version the client negotiated, or `None` before peer info is recorded.
pub fn protocol_version(&self) -> Option<crate::model::ProtocolVersion> {
self.peer
.peer_info()
.map(|info| info.protocol_version.clone())
}
}
/// Request execution context
#[derive(Debug, Clone)]
#[non_exhaustive]