Closed Bug 289518 Opened 20 years ago Closed 20 years ago

Let nsXFormsUtils::ReportError() report fatal errors etc. too

Categories

(Core Graveyard :: XForms, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: allan, Assigned: doronr)

References

()

Details

Attachments

(3 files)

As Aaron suggested in bug 287714, it should be possible to report fatal errors,
and not just messages, with nsXFormsUtils::ReportError(). biesi suggested we use
something like:
http://lxr.mozilla.org/seamonkey/source/js/src/xpconnect/idl/nsIScriptError.idl#101
The main problem with nsIScriptError is that it always shows line numbers, even
if it is "0".

So the scripterror XBL binding needs some changing.
The console issue is bug 289926 (xpfe) and 289927 (toolkit).
Assignee: allan → aaronr
The console issue is bug 289926 (xpfe) and 289927 (toolkit).
Assignee: aaronr → doronr
Attached patch initial patchSplinter Review
Attachment #180382 - Flags: review?(aaronr)
Comment on attachment 180382 [details] [diff] [review]
initial patch

+	 nsXFormsUtils::ReportError(NS_LITERAL_STRING("schemaLoadError"),
mElement, 0);

Need to use some kind of flag or define.  0 means nothing to me when reading
through the code.  Maybe use the same flag(s) that already exist in
nsIScriptError?

+	 ds->SerializeToString(tmpNode, srcLine);

I'd suggest using a different variable name.  This is more of a context type of
value.	When I see srcLine, I think the line number in the src or the actual
line of source.  Not serialized node info.


+   * @param aErrorType        Type of error.
+				 0 - error
+				 1 - warning
+				 2 - exception
+				 3 - strict

when you change to flags, make sure that you change the comments for
ReportError in nsXFormsUtils.h
Attachment #180382 - Flags: review?(aaronr) → review-
Attachment #180400 - Flags: review?(aaronr)
Comment on attachment 180400 [details] [diff] [review]
with review comments addressed

More that I think about it, why not just make the default error flag be
nsIScriptError::errorFlag?  Then most of these changes aren't necessary.  Could
even create a corresponding ::ReportWarning with a default of
nsIScriptError::warningFlag

But the code as it is has no problems that I can see.  Either way,  r=me
Attachment #180400 - Flags: review?(aaronr) → review+
(In reply to comment #7)
> (From update of attachment 180400 [details] [diff] [review] [edit])
> More that I think about it, why not just make the default error flag be
> nsIScriptError::errorFlag?  Then most of these changes aren't necessary.  Could
> even create a corresponding ::ReportWarning with a default of
> nsIScriptError::warningFlag

I second to that.
Attached patch use defaultsSplinter Review
Attachment #180486 - Flags: review?(allan)
Comment on attachment 180486 [details] [diff] [review]
use defaults

Except for the bonus nop-change in nsXFormsUtils.cpp, everything's good.
Attachment #180486 - Flags: review?(allan) → review+
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: