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:
parent
8f5310b424
commit
95a8e961e0
1 changed files with 126 additions and 4 deletions
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Reference in a new issue