[gxml/gsoc2013: 27/69] NodeList.vala: change error handling to g_warning



commit 58b0db8026e5651d3993f67e3a74924ae7086c52
Author: Richard Schwarting <aquarichy gmail com>
Date:   Sat Jul 27 00:01:52 2013 -0400

    NodeList.vala: change error handling to g_warning

 gxml/NodeList.vala |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/gxml/NodeList.vala b/gxml/NodeList.vala
index b22117b..dfd3d8d 100644
--- a/gxml/NodeList.vala
+++ b/gxml/NodeList.vala
@@ -100,10 +100,10 @@ namespace GXml {
                // TODO: wow, lots of those GList compatibility methods are the same in a case like this.
 
                /* These exist to support management of a node's children */
-               internal abstract DomNode? insert_before (DomNode new_child, DomNode? ref_child) throws 
DomError;
-               internal abstract DomNode? replace_child (DomNode new_child, DomNode old_child) throws 
DomError;
-               internal abstract DomNode? remove_child (DomNode old_child) /*throws DomError*/;
-               internal abstract DomNode? append_child (DomNode new_child) /*throws DomError*/;
+               internal abstract DomNode? insert_before (DomNode new_child, DomNode? ref_child);
+               internal abstract DomNode? replace_child (DomNode new_child, DomNode old_child);
+               internal abstract DomNode? remove_child (DomNode old_child);
+               internal abstract DomNode? append_child (DomNode new_child);
 
                /**
                 * Creates an XML string representation of the nodes in the list.
@@ -527,9 +527,8 @@ namespace GXml {
                                child = child->next;
                        }
                        if (child == null) {
-                               this.owner.last_error = new DomError.NOT_FOUND ("ref_child not found.");
+                               GLib.warning ("NOT_FOUND_ERR: ref_child '%s' not found, was supposed to have 
'%s' inserted before it.", ref_child.node_name, new_child.node_name);
                                return null;
-                               // TODO: provide a more useful description of ref_child, but there are so 
many different types
                        } else {
                                if (new_child.node_type == NodeType.DOCUMENT_FRAGMENT) {
                                        foreach (DomNode new_grand_child in new_child.child_nodes) {
@@ -566,8 +565,7 @@ namespace GXml {
                                        // it is a valid child
                                        child->replace (((BackedNode)new_child).node);
                                } else {
-                                       this.owner.last_error = new DomError.NOT_FOUND ("old_child not 
found");
-                                       // TODO: provide more useful descr. of old_child
+                                       GLib.warning ("NOT_FOUND_ERR: old_child '%s' not found, tried to 
replace with '%s'", old_child.node_name, new_child.node_name);
                                }
                        }
 


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