Closed Bug 287714 Opened 20 years ago Closed 20 years ago

Add console outputting of errors.

Categories

(Core Graveyard :: XForms, defect)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: doronr, Assigned: doronr)

Details

Attachments

(3 files, 3 obsolete files)

 
Attached patch initial patch (obsolete) — Splinter Review
Attachment #178584 - Flags: review?(aaronr)
comments:

XformsUtils::ReportError():
 - Why have to clone aElement?  Why can't you serialize aElement directly
instead of using tmpNode?
 - Should we log empty strings?  I'd vote no which would require an extra test
in here.

nsXFormsUtils.h:
 - you need to add comments to the ReportError declaration.
Attachment #178584 - Attachment is obsolete: true
Attachment #178584 - Flags: review?(aaronr)
Attached patch with nits covered (obsolete) — Splinter Review
Attachment #178804 - Flags: review?(aaronr)
+    // if a context was defined, we clone (not deep) it, serialize it and append
+    // to the message.
+    if (aContext) {
+      nsCOMPtr<nsIDOMSerializer> ds = do_GetService(NS_XMLSERIALIZER_CONTRACTID);
+      if (ds) {
+        nsAutoString contextMsg;
+        nsCOMPtr<nsIDOMNode> tmpNode;
+        // SerializeToString always does a deep serialize, so we do a non-deep
+        // clone so that we don't serialize any children.
+        aElement->CloneNode(PR_FALSE, getter_AddRefs(tmpNode));
+

Shouldn't you be cloning aContext and not aElement?
Attachment #178804 - Attachment is obsolete: true
Attachment #178804 - Flags: review?(aaronr)
Attached patch more nit fixingSplinter Review
Attachment #178828 - Flags: review?(aaronr)
Attachment #178828 - Flags: review?(aaronr) → review+
Attached patch add localization (obsolete) — Splinter Review
Attachment #178959 - Flags: review?(aaronr)
Attachment #178959 - Attachment is obsolete: true
Attachment #178959 - Flags: review?(aaronr)
Attached patch better patchSplinter Review
Attachment #178965 - Flags: review?(aaronr)
Attached file testcase
Comment on attachment 178965 [details] [diff] [review]
better patch

I'd really like to see a way to log errors and warnings to the console too,
instead of just "messages".  IRC says that should just be a flag on the
nsIConsoleMessage.  That way we can have a easy way to pick out "fatal errors"
where we stop processing the form. 

But we can do that in a seperate bug if you want.

r=me
Attachment #178965 - Flags: review?(aaronr) → review+
Using nsIConsoleMessage would mean I would have to create a nsIXFormsError that
implements it and all.  Doable, but I think warnings is good enough for now :)
checked in.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: