@@ -10,11 +10,21 @@ use crate::{AmqpOrderedMap, AmqpSymbol, AmqpValue};
1010/// Type of AMQP error.
1111pub enum AmqpErrorKind {
1212 AmqpDescribedError ( AmqpDescribedError ) ,
13+
1314 /// Remote peer closed the link
14- ClosedByRemote ( Box < dyn std:: error:: Error + Send + Sync > ) ,
15+ LinkClosedByRemote ( Box < dyn std:: error:: Error + Send + Sync > ) ,
16+ /// Remote peer closed the session
17+ SessionClosedByRemote ( Box < dyn std:: error:: Error + Send + Sync > ) ,
18+ /// Remote peer closed the connection
19+ ConnectionClosedByRemote ( Box < dyn std:: error:: Error + Send + Sync > ) ,
20+
21+ /// Remote peer detached the link
22+ LinkDetachedByRemote ( Box < dyn std:: error:: Error + Send + Sync > ) ,
23+ /// Remote peer detached the session
24+ SessionDetachedByRemote ( Box < dyn std:: error:: Error + Send + Sync > ) ,
1525
16- /// Remote peer detached
17- DetachedByRemote ( Box < dyn std:: error:: Error + Send + Sync > ) ,
26+ /// Remote peer detached the connection
27+ ConnectionDetachedByRemote ( Box < dyn std:: error:: Error + Send + Sync > ) ,
1828
1929 /// The send request was rejected by the remote peer.
2030 NonTerminalDeliveryState ,
@@ -83,6 +93,7 @@ create_extensible_enum!(
8393 SessionCannotBeLocked ,
8494 "com.microsoft:session-cannot-be-locked"
8595 ) ,
96+ ( EntityUpdated , "com.microsoft:entity-updated" ) ,
8697 ( MessageNotFound , "com.microsoft:message-not-found" ) ,
8798 ( SessionNotFound , "com.microsoft:session-not-found" ) ,
8899 ( EntityAlreadyExists , "com.microsoft:entity-already-exists" ) ,
@@ -182,8 +193,12 @@ impl std::error::Error for AmqpError {
182193 match & self . kind {
183194 AmqpErrorKind :: TransportImplementationError ( s)
184195 | AmqpErrorKind :: DetachError ( s)
185- | AmqpErrorKind :: ClosedByRemote ( s)
186- | AmqpErrorKind :: DetachedByRemote ( s)
196+ | AmqpErrorKind :: LinkClosedByRemote ( s)
197+ | AmqpErrorKind :: LinkDetachedByRemote ( s)
198+ | AmqpErrorKind :: SessionClosedByRemote ( s)
199+ | AmqpErrorKind :: SessionDetachedByRemote ( s)
200+ | AmqpErrorKind :: ConnectionClosedByRemote ( s)
201+ | AmqpErrorKind :: ConnectionDetachedByRemote ( s)
187202 | AmqpErrorKind :: LinkStateError ( s)
188203 | AmqpErrorKind :: ConnectionDropped ( s) => Some ( s. as_ref ( ) ) ,
189204 AmqpErrorKind :: ManagementStatusCode ( _, _) => None ,
@@ -211,11 +226,23 @@ impl std::fmt::Display for AmqpError {
211226 write ! ( f, "Management API returned status code: {}" , status_code, )
212227 }
213228 }
214- AmqpErrorKind :: DetachedByRemote ( err) => {
215- write ! ( f, "Remote detached with error: {}" , err)
229+ AmqpErrorKind :: ConnectionDetachedByRemote ( err) => {
230+ write ! ( f, "Remote connection detached with error: {}" , err)
231+ }
232+ AmqpErrorKind :: LinkDetachedByRemote ( err) => {
233+ write ! ( f, "Remote link detached with error: {}" , err)
234+ }
235+ AmqpErrorKind :: SessionDetachedByRemote ( err) => {
236+ write ! ( f, "Remote session detached with error: {}" , err)
237+ }
238+ AmqpErrorKind :: LinkClosedByRemote ( err) => {
239+ write ! ( f, "Remote link closed with error: {}" , err)
240+ }
241+ AmqpErrorKind :: SessionClosedByRemote ( err) => {
242+ write ! ( f, "Remote session closed with error: {}" , err)
216243 }
217- AmqpErrorKind :: ClosedByRemote ( err) => {
218- write ! ( f, "Remote closed with error: {}" , err)
244+ AmqpErrorKind :: ConnectionClosedByRemote ( err) => {
245+ write ! ( f, "Remote connection closed with error: {}" , err)
219246 }
220247 AmqpErrorKind :: DetachError ( err) => {
221248 write ! ( f, "AMQP Detach Error: {} " , err)
0 commit comments