You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Boris Kolpackov <bo...@codesynthesis.com> on 2008/03/06 13:50:37 UTC

Changes to some error messages

Hi,

Some of the diagnostics messages reported via the ErrorHandler
interface have the prefix in the form "An exception occurred!
Type:RuntimeException, Message:", for example:

"An exception occurred! Type:RuntimeException, Message:The primary
 document entity could not be opened. Id=/tmp/test.xml"

I would like to remove this prefix for the following reasons:

1. I get this error or warning via the error handler interface, along with
   things like XML well-formedness and XML Schema validation errors. The
   fact that this error is internally represented as an exception and its
   type don't add any useful information to the message. These are
   implementation details of Xerces-C++.

2. It is inconsistent with the way other errors and warning (e.g., XML,
   XML Schema, etc.) are formatted.

3. It is ugly. I personally don't like any exclamation marks in the
   diagnostics that my applications produce).

Let me know if you have any objections.

Boris


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


RE: Changes to some error messages

Posted by Th...@emc.com.
Thanks for the clarification.

-----Original Message-----
From: Boris Kolpackov [mailto:boris@codesynthesis.com] 
Sent: Thursday, March 06, 2008 9:37 AM
To: c-dev@xerces.apache.org
Subject: Re: Changes to some error messages

Hi Nicholas,

Thayer_Nicholas@emc.com <Th...@emc.com> writes:

> Perhaps the following format would be better to allow grep'ing of all
> ^[ERROR|WARNING|INFO|DEBUG|FATAL] in log files.
>
> [ERROR|WARNING|INFO|DEBUG|FATAL]: "Msg text here"

The severity information is delivered to ErrorHandler separately
from the message itself. So you can always prefix it with ERROR,
WARNING, etc., in your output (while some people might prefer error,
warning, etc).

Boris

-- 
Boris Kolpackov, Code Synthesis Tools
Open source XML data binding for C++:
http://codesynthesis.com/products/xsd
Mobile/embedded validating XML parsing:
http://codesynthesis.com/products/xsde

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


Re: Changes to some error messages

Posted by Boris Kolpackov <bo...@codesynthesis.com>.
Hi Nicholas,

Thayer_Nicholas@emc.com <Th...@emc.com> writes:

> Perhaps the following format would be better to allow grep'ing of all
> ^[ERROR|WARNING|INFO|DEBUG|FATAL] in log files.
>
> [ERROR|WARNING|INFO|DEBUG|FATAL]: "Msg text here"

The severity information is delivered to ErrorHandler separately
from the message itself. So you can always prefix it with ERROR,
WARNING, etc., in your output (while some people might prefer error,
warning, etc).

Boris

-- 
Boris Kolpackov, Code Synthesis Tools
Open source XML data binding for C++:   http://codesynthesis.com/products/xsd
Mobile/embedded validating XML parsing: http://codesynthesis.com/products/xsde

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


RE: Changes to some error messages

Posted by Th...@emc.com.
I agree, error and warning messages should be very point of fact
containing as much pertinent information as possible without any fluff.
Perhaps the following format would be better to allow grep'ing of all
^[ERROR|WARNING|INFO|DEBUG|FATAL] in log files.

[ERROR|WARNING|INFO|DEBUG|FATAL]: "Msg text here"

Regards,
Nicholas 

-----Original Message-----
From: Boris Kolpackov [mailto:boris@codesynthesis.com] 
Sent: Thursday, March 06, 2008 5:51 AM
To: c-dev@xerces.apache.org
Subject: Changes to some error messages

Hi,

Some of the diagnostics messages reported via the ErrorHandler
interface have the prefix in the form "An exception occurred!
Type:RuntimeException, Message:", for example:

"An exception occurred! Type:RuntimeException, Message:The primary
 document entity could not be opened. Id=/tmp/test.xml"

I would like to remove this prefix for the following reasons:

1. I get this error or warning via the error handler interface, along
with
   things like XML well-formedness and XML Schema validation errors. The
   fact that this error is internally represented as an exception and
its
   type don't add any useful information to the message. These are
   implementation details of Xerces-C++.

2. It is inconsistent with the way other errors and warning (e.g., XML,
   XML Schema, etc.) are formatted.

3. It is ugly. I personally don't like any exclamation marks in the
   diagnostics that my applications produce).

Let me know if you have any objections.

Boris


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


Re: Changes to some error messages

Posted by Boris Kolpackov <bo...@codesynthesis.com>.
Hi David,

David Bertoni <db...@apache.org> writes:

> This sounds great, but it will affect the expected output of the test
> suite, so it may require some significant fixes there as well.

Hm, I just checked and none of the files in the tests directory
have the "An exception ..." hardcoded in them.


> Also, there are cases where XMLExceptions are caught and their text is
> reported in the error handling chain, with the text being bundled into a
> new RuntimeException or SAXParseException, so you may need to clean up
> more than just the message resources.

Hm, I am not sure I follow you. Can you point me to a concrete example
of this happening?


Thanks,
Boris

-- 
Boris Kolpackov, Code Synthesis Tools
Open source XML data binding for C++:   http://codesynthesis.com/products/xsd
Mobile/embedded validating XML parsing: http://codesynthesis.com/products/xsde

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


Re: Changes to some error messages

Posted by David Bertoni <db...@apache.org>.
Boris Kolpackov wrote:
> Hi,
> 
> Some of the diagnostics messages reported via the ErrorHandler
> interface have the prefix in the form "An exception occurred!
> Type:RuntimeException, Message:", for example:
> 
> "An exception occurred! Type:RuntimeException, Message:The primary
>  document entity could not be opened. Id=/tmp/test.xml"
> 
> I would like to remove this prefix for the following reasons:
> 
> 1. I get this error or warning via the error handler interface, along with
>    things like XML well-formedness and XML Schema validation errors. The
>    fact that this error is internally represented as an exception and its
>    type don't add any useful information to the message. These are
>    implementation details of Xerces-C++.
> 
> 2. It is inconsistent with the way other errors and warning (e.g., XML,
>    XML Schema, etc.) are formatted.
> 
> 3. It is ugly. I personally don't like any exclamation marks in the
>    diagnostics that my applications produce).
> 
> Let me know if you have any objections.
This sounds great, but it will affect the expected output of the test 
suite, so it may require some significant fixes there as well.

Also, there are cases where XMLExceptions are caught and their text is 
reported in the error handling chain, with the text being bundled into a 
new RuntimeException or SAXParseException, so you may need to clean up more 
than just the message resources.

Dave

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org