[librsvg: 3/16] AcquireError: Add a MaxReferencesExceeded variant



commit 2650d970853033dd369ef050702e310c46d98477
Author: Federico Mena Quintero <federico gnome org>
Date:   Thu Oct 10 15:37:56 2019 -0500

    AcquireError: Add a MaxReferencesExceeded variant

 rsvg_internals/src/error.rs | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/rsvg_internals/src/error.rs b/rsvg_internals/src/error.rs
index dde82541..dff26a4e 100644
--- a/rsvg_internals/src/error.rs
+++ b/rsvg_internals/src/error.rs
@@ -128,6 +128,7 @@ pub enum AcquireError {
     LinkNotFound(Fragment),
     InvalidLinkType(Fragment),
     CircularReference(Fragment),
+    MaxReferencesExceeded,
 }
 
 impl error::Error for AcquireError {
@@ -135,7 +136,8 @@ impl error::Error for AcquireError {
         match *self {
             AcquireError::LinkNotFound(_) => "link not found",
             AcquireError::InvalidLinkType(_) => "link is to object of invalid type",
-            AcquireError::CircularReference(_) => "circular reference in link"
+            AcquireError::CircularReference(_) => "circular reference in link",
+            AcquireError::MaxReferencesExceeded => "maximum number of references exceeded",
         }
     }
 }
@@ -151,6 +153,9 @@ impl fmt::Display for AcquireError {
 
             AcquireError::CircularReference(ref frag) =>
                 write!(f, "circular reference in link {}", frag),
+
+            AcquireError::MaxReferencesExceeded =>
+                write!(f, "{}", self.description()),
         }
     }
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]