Boost C++ Libraries: Ticket #3694: First letter of error messages should be in uppercase https://svn.boost.org/trac10/ticket/3694 <p> Usually error messages begin with a capital letter. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3694 Trac 1.4.3 Vadim Guchenko <techmsgs@…> Sun, 29 Nov 2009 12:11:46 GMT cc set https://svn.boost.org/trac10/ticket/3694#comment:1 https://svn.boost.org/trac10/ticket/3694#comment:1 <ul> <li><strong>cc</strong> <span class="trac-author">techmsgs@…</span> added </li> </ul> Ticket viboes Sun, 29 Nov 2009 17:23:45 GMT cc changed https://svn.boost.org/trac10/ticket/3694#comment:2 https://svn.boost.org/trac10/ticket/3694#comment:2 <ul> <li><strong>cc</strong> <span class="trac-author">viboes</span> added </li> </ul> <p> Replying to <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3694" title="#3694: Bugs: First letter of error messages should be in uppercase (closed: wontfix)">Vadim Guchenko &lt;techmsgs@…&gt;</a>: </p> <blockquote class="citation"> <p> Usually error messages begin with a capital letter. </p> </blockquote> <p> Please, could you be more precise? </p> Ticket Sascha Ochsenknecht Sun, 06 Dec 2009 12:23:43 GMT cc changed https://svn.boost.org/trac10/ticket/3694#comment:3 https://svn.boost.org/trac10/ticket/3694#comment:3 <ul> <li><strong>cc</strong> <span class="trac-author">s.ochsenknecht@…</span> added </li> </ul> Ticket Vadim Guchenko <techmsgs@…> Sun, 06 Dec 2009 13:43:41 GMT <link>https://svn.boost.org/trac10/ticket/3694#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3694#comment:4</guid> <description> <p> Consider examples/real.cpp: </p> <pre class="wiki">s1# ./real --output required parameter is missing in 'output' s1# ./real --br unknown option br </pre><p> I would like the output to be: </p> <pre class="wiki">s1# ./real --output Required parameter is missing in 'output' s1# ./real --br Unknown option br </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Sascha Ochsenknecht</dc:creator> <pubDate>Sun, 06 Dec 2009 13:51:24 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3694#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3694#comment:5</guid> <description> <p> You're talking about the messages/strings returned by the what() function of the related exception type. These strings are NOT meant to give an error message to user. Of course you can use them, but you don't have control over them (localisation etc.). </p> <p> The use of different exception types/classes enables you to generate your own error messages which fit in your environment/application. </p> <p> You catch the exception and depending on the catched type you generate an error/warning/message or whatever to the user. </p> <p> The what() message can be seen as a fall-back if you don't have an appropriate handling of the related exception. </p> <p> Does it make sense? </p> <p> Cheers, SAscha </p> </description> <category>Ticket</category> </item> <item> <author>Vadim Guchenko <techmsgs@…></author> <pubDate>Sun, 06 Dec 2009 14:39:40 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3694#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3694#comment:6</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/3694#comment:5" title="Comment 5">s_ochsenknecht</a>: </p> <blockquote class="citation"> <p> You're talking about the messages/strings returned by the what() function of the related exception type. These strings are NOT meant to give an error message to user. Of course you can use them, but you don't have control over them (localisation etc.). </p> </blockquote> <p> I disagree with you. I always use text messages from exceptions and output them to the log/console, optionally adding some prefix. I examine the exception class only when I need to do some work dependent on the class. Localization is a task of the library, not of the user application. The user may only choose what locale to use. </p> <p> Moreover, the same exception class is often used in different contexts to throw exceptions with different text messages. Such text messages may contain information that cannot be gotten from the exception class (for instance, the name of the option which caused a error). </p> <blockquote class="citation"> <p> The use of different exception types/classes enables you to generate your own error messages which fit in your environment/application. You catch the exception and depending on the catched type you generate an error/warning/message or whatever to the user. </p> </blockquote> <p> Do you suggest to catch every possible exception class in the application in order to give some adapted error message to the user? That is wrong approach. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Sascha Ochsenknecht</dc:creator> <pubDate>Sun, 06 Dec 2009 15:42:55 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3694#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3694#comment:7</guid> <description> <p> At <a href="http://www.boost.org/community/error_handling.html">Error and Exception handling</a> you can find a guideline on how exceptions should be used within boost libraries. </p> <p> Specially point 5 says: </p> <ol start="5"><li>*Don't worry too much about the what() message*. It's nice to have a message that a programmer stands a chance of figuring out, but you're very unlikely to be able to compose a relevant and user-comprehensible error message at the point an exception is thrown. Certainly, internationalization is beyond the scope of the exception class author. Peter Dimov makes an excellent argument that the proper use of a what() string is to serve as a key into a table of error message formatters. Now if only we could get standardized what() strings for exceptions thrown by the standard library... </li></ol><p> In my opinion it is quite hard to fit all user needs regarding to the messages what() produces. So, maybe the next ticket occurs which says "please, first letter should be lowercase". You get a message and you can use it, but you also have the possibility to format your own one. Its up to you. </p> <p> Anyhow, this is a general topic and maybe it is something for the mailing list. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Vladimir Prus</dc:creator> <pubDate>Tue, 08 Dec 2009 14:33:54 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3694#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3694#comment:8</guid> <description> <p> The way I meant to use the 'what' text, is after printing a suitable preamble. E.g. </p> <pre class="wiki">Error has occured: &lt;text-from-what&gt; </pre><p> In such context, capitalization is not needed. It seems to be that prepending error messages with some preamble, even just "Error:" helps to distinguish them from other output from the program. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Sascha Ochsenknecht</dc:creator> <pubDate>Thu, 10 Dec 2009 11:21:11 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/3694#comment:9 https://svn.boost.org/trac10/ticket/3694#comment:9 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">wontfix</span> </li> </ul> Ticket