[gxml] Improve error messages



commit 1b469a775174d25960813ab09e0c8009c9e38a01
Author: Rafael Fontenelle <rafaelff gnome org>
Date:   Wed Dec 28 15:03:15 2016 -0600

    Improve error messages

 gxml/GXmlDomCollections.vala |    2 +-
 gxml/GXmlDomRange.vala       |    2 +-
 gxml/GomElement.vala         |    8 ++++----
 gxml/GomNode.vala            |    4 ++--
 gxml/XParser.vala            |    2 +-
 5 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/gxml/GXmlDomCollections.vala b/gxml/GXmlDomCollections.vala
index 6f8ec0e..6b9119e 100644
--- a/gxml/GXmlDomCollections.vala
+++ b/gxml/GXmlDomCollections.vala
@@ -49,7 +49,7 @@ public class GXml.GDomTokenList : Gee.ArrayList<string>, GXml.DomTokenList {
 
   public new bool contains (string token) throws GLib.Error {
     if (token == "")
-      throw new GXml.DomError.SYNTAX_ERROR (_("DOM: Invalid token. No empty string can could be used as 
token to check if it is contained in token list"));
+      throw new GXml.DomError.SYNTAX_ERROR (_("DOM: Invalid token. No empty string could be used as token to 
check if it is contained in token list"));
     if (" " in token)
       throw new GXml.DomError.INVALID_CHARACTER_ERROR (_("DOM: Invalid token. No white spaces could be 
included as token to check if it is contained in token list"));
     return base.contains (token);
diff --git a/gxml/GXmlDomRange.vala b/gxml/GXmlDomRange.vala
index e62e6a0..e82650c 100644
--- a/gxml/GXmlDomRange.vala
+++ b/gxml/GXmlDomRange.vala
@@ -163,7 +163,7 @@ public class GXml.GDomRange : Object, GXml.DomRange {
                                       DomRange source_range) throws GLib.Error
        {
                if (_start_container.parent_node != source_range.start_container.parent_node)
-                       throw new DomError.WRONG_DOCUMENT_ERROR (_("Invalid root's in range"));
+                       throw new DomError.WRONG_DOCUMENT_ERROR (_("Invalid root is in the range"));
                switch (how) {
                        case BoundaryPoints.START_TO_START:
                                set_start (_start_container, 0);
diff --git a/gxml/GomElement.vala b/gxml/GomElement.vala
index f637221..1219b71 100644
--- a/gxml/GomElement.vala
+++ b/gxml/GomElement.vala
@@ -443,13 +443,13 @@ public class GXml.GomElement : GomNode,
     } else
       n = name;
     if (namespace_uri == null && p == "")
-       throw new DomError.NAMESPACE_ERROR (_("Invalid namespace. If prefix is null, name space uri shoud not 
be null"));
+       throw new DomError.NAMESPACE_ERROR (_("Invalid namespace. If prefix is null, namespace URI should not 
be null"));
     if (p == "xml" && namespace_uri != "http://www.w3.org/2000/xmlns/";)
-       throw new DomError.NAMESPACE_ERROR (_("Invalid namespace. If prefix is xml name space uri shoud be 
http://www.w3.org/2000/xmlns/";));
+       throw new DomError.NAMESPACE_ERROR (_("Invalid namespace. If prefix is xml, namespace URI should be 
http://www.w3.org/2000/xmlns/";));
     if (p == "xmlns" && namespace_uri != "http://www.w3.org/2000/xmlns/";)
-       throw new DomError.NAMESPACE_ERROR (_("Invalid namespace. If attribute's prefix is xmlns name space 
uri shoud be http://www.w3.org/2000/xmlns/";));
+       throw new DomError.NAMESPACE_ERROR (_("Invalid namespace. If attribute's prefix is xmlns, namespace 
URI should be http://www.w3.org/2000/xmlns/";));
     if (p == "" && n == "xmlns" && namespace_uri != "http://www.w3.org/2000/xmlns/";)
-       throw new DomError.NAMESPACE_ERROR (_("Invalid namespace. If attribute's name is xmlns name space uri 
shoud be http://www.w3.org/2000/xmlns/";));
+       throw new DomError.NAMESPACE_ERROR (_("Invalid namespace. If attribute's name is xmlns, namespace URI 
should be http://www.w3.org/2000/xmlns/";));
     if (p == "" && n != "xmlns" && n != "xml")
       throw new DomError.NAMESPACE_ERROR (_("Invalid attribute name. No prefixed attributes should use xmlns 
name"));
     var a = new GomAttr.namespace (this, namespace_uri, p, n, value);
diff --git a/gxml/GomNode.vala b/gxml/GomNode.vala
index 34582a4..3c51908 100644
--- a/gxml/GomNode.vala
+++ b/gxml/GomNode.vala
@@ -246,12 +246,12 @@ public class GXml.GomNode : Object,
         string nsuri = node.lookup_namespace_uri (e.prefix);
         if (nsprefix != null && nsprefix != e.prefix) {
           throw new DomError.NAMESPACE_ERROR
-            (_("Trying to add a namespaced element to a parent with invalid prefix for namesapce %s ")
+            (_("Trying to add a namespaced element to a parent with invalid prefix for namespace %s")
               .printf (e.namespace_uri));
         }
         if (nsuri != null && nsuri != e.namespace_uri) {
           throw new DomError.NAMESPACE_ERROR
-            (_("Trying to add a namespaced element to a parent with invalid uri for prefix %s ")
+            (_("Trying to add a namespaced element to a parent with invalid URI for prefix %s")
               .printf (e.prefix));
         }
       }
diff --git a/gxml/XParser.vala b/gxml/XParser.vala
index 9a6671d..6f272af 100644
--- a/gxml/XParser.vala
+++ b/gxml/XParser.vala
@@ -86,7 +86,7 @@ public class GXml.XParser : Object, GXml.Parser {
   }
   public void read_string (string str, GLib.Cancellable? cancellable) throws GLib.Error {
     if (str == "")
-      throw new ParserError.INVALID_DATA_ERROR (_("Invalid document string, is empty is not allowed"));
+      throw new ParserError.INVALID_DATA_ERROR (_("Invalid document string, it is empty or is not allowed"));
     StringBuilder s = new StringBuilder (str);
     var stream = new GLib.MemoryInputStream.from_data (str.data);
     read_stream (stream, cancellable);


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