add a ReleaseCapacityTooBig variant to UserError
This commit is contained in:
committed by
Carl Lerche
parent
452e49dc3e
commit
09744f38ef
@@ -37,6 +37,9 @@ pub enum UserError {
|
|||||||
|
|
||||||
/// The application attempted to initiate too many streams to remote.
|
/// The application attempted to initiate too many streams to remote.
|
||||||
Rejected,
|
Rejected,
|
||||||
|
|
||||||
|
/// The released capacity is larger than claimed capacity.
|
||||||
|
ReleaseCapacityTooBig,
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===== impl RecvError =====
|
// ===== impl RecvError =====
|
||||||
@@ -109,6 +112,7 @@ impl error::Error for UserError {
|
|||||||
UnexpectedFrameType => "unexpected frame type",
|
UnexpectedFrameType => "unexpected frame type",
|
||||||
PayloadTooBig => "payload too big",
|
PayloadTooBig => "payload too big",
|
||||||
Rejected => "rejected",
|
Rejected => "rejected",
|
||||||
|
ReleaseCapacityTooBig => "release capacity too big",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -215,9 +215,9 @@ impl<B, P> Recv<B, P>
|
|||||||
-> Result<(), UserError>
|
-> Result<(), UserError>
|
||||||
{
|
{
|
||||||
trace!("release_capacity; size={}", capacity);
|
trace!("release_capacity; size={}", capacity);
|
||||||
|
|
||||||
if capacity > stream.in_flight_recv_data {
|
if capacity > stream.in_flight_recv_data {
|
||||||
// TODO: Handle error
|
return Err(UserError::ReleaseCapacityTooBig);
|
||||||
unimplemented!();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Decrement in-flight data
|
// Decrement in-flight data
|
||||||
|
|||||||
Reference in New Issue
Block a user