[OpendTect_Developers] Creating detailed error messages in OpendTect

Kristofer Tingdahl kristofer.tingdahl at dgbes.com
Mon Dec 14 23:21:43 CET 2009


Dear fellow developers,

In version 4 of OpendTect, we added uiMsg::errorWithDetail( const
FileMultiString&) function in uimsg.h/.cc. And it aims to give you a better
mechanism to provide the user (and eventually also support) with a more
informative error message.

To the novel user, we want to say "Could not load well", and he may be fine
with that. The more advanced user (as well as support) wants to know WHY did
the well not load. Perhaps the file was missing, perhaps the time to depth
file was corrupt. Perhaps it was a more internal problem: OD ran into a
mutex deadlock or a thread did not exit as expected. Those more technical,
secondary messages can be conveyed to the user with the new
'errorWithDetail'  function.

If you give a FileMultiString with "Could not load well ABCD`Could not load
time2depth file`Wrong filetype`, the user will initially only see the "Could
not load well ABCD". The other messages come up if you press the "Show
Details ..." button in the dialog.

The actual code to create such an error message would be:

#include "separstr.h" //For FileMultiString
#include "uimsg.h"    //for uiMSG
#include "bufstring.h" //for BufferString
....

//Create BufferString with error and well name
BufferString firstmessage = "Could not load well ";
firstmessage += wellname;

FileMultiString errormessage = firstmessage;

//Add more detail
errormessage += "Wrong filetype";

//Display the message
uiMSG().errorWithDetail( errormessage );



The advanced user can take action based on the information (like a corrupt
file), and the novel user can easier get support from the support team, and
we as developer may get more informative error messages.


Happy coding,

Kristofer

-- 
Kristofer Tingdahl, Ph. D.
Executive Vice President - Americas
dGB Earth Sciences
+1 281 240 3939
http://www.dgbes.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opendtect.org/pipermail/developers/attachments/20091214/4091edd5/attachment.html>


More information about the Developers mailing list