Page 1 of 1
Customizing error reporting dialog
Posted: Fri Dec 19, 2008 10:02 am
by paulclaude
Is there any way to customize the error reporting dialog of the standalone builder?
I need to have some more information, such as OS host type and version, etc.
May I add some script to customize the error report?
Posted: Fri Dec 19, 2008 11:49 am
by Janschenkel
When an error occurs and isn't handled in a
try-catch structure, the engine will send an
errorDialog message that you can handle to display your own dialog box and provide more information.
The
errorDialog message has two parameters, which are unfortunately not very well documented. You can either gleen the necessary information from the 'revBackscript' backscript, or use a library like
ErrorLib by forum veteran Mark Schonewille.
Another option is to file an enhancement request in the
Qualiy Center to ask the Revolution team to extend the default error dialog with additional information, such as
the platform,
the systemVersion,
the machine,
the environment,
the version,
the buildNumber, and whatever else you think may come in handy for tracking errors.
HTH,
Jan Schenkel.
Posted: Mon Dec 22, 2008 2:42 pm
by paulclaude
Janschenkel wrote:When an error occurs and isn't handled in a try-catch structure, the engine will send an errorDialog message that you can handle to display your own dialog box and provide more information.
The errorDialog message has two parameters, which are unfortunately not very well documented. You can either gleen the necessary information from the 'revBackscript' backscript
Hi Jan,
I've seen:
on errorDialog pWhatError, pWhatError2
######################
close printing
global gREVSuppressErrors, gREVDevelopment
if gREVDevelopment then write the params & cr & the long time & cr & "--------" & cr & cr to stdOut
if gREVSuppressErrors then exit errorDialog
filter pWhatError without "*,0,0"
if (item 1 of pWhatError is not a number or item 2 of pWhatError is not a number) and the number of words in pWhatError is not 0 then
answer "The following user thrown error was generated and not handled, so it was intercepted by Revolution:" & cr & cr & the params
exit errorDialog
end if
if the number of lines in pWhatError is 0 then exit errorDialog -- bogus error
set the executionError of stack "revErrorDisplay" to pWhatError
set the scriptError of stack "revErrorDisplay" to pWhatError2
repeat for each line l in pWhatError
if item 1 of l is 353 then
set the errorObject of stack "revErrorDisplay" to item -1 of l
exit repeat
end if
end repeat
if the mode of stack "revErrorDisplay" is not 0 then
send "preOpenCard" to cd 1 of stack "revErrorDisplay"
send "opencard" to cd 1 of stack "revErrorDisplay"
else
modeless "revErrorDisplay"
end if
end errorDialog
It seems to me that the errorDialog calls the "revErrorDisplay" stack, trapping the error messages in the IDE; I need to handle the error reporting dialog (bug reports tab) for the error messages sent by a standalone application.
Or I'm wrong?
Posted: Mon Dec 22, 2008 8:47 pm
by Janschenkel
That is indeed how the Revolution IDE handles error dialogs; the standalone builder injects its own flavour of error dialog, which includes the "Send mail report" button.
WARNING: the following is not for the faint-of-heart and you should only do it if you feel comfortable making changes to the Revolution IDE!
A bit of sleuthing revealed that this is the substack "revErrorReport" of stack "revSaveAsStandalone" - and if you feel up to a bit of hacking, you can modify the preOpenCard handler of card id 1002 of stack "revErrorReport" to extend the variable tErrorString with the additional information that you want included in the error report.
Before you go about and modify the script, make a backup copy of stack "revStandaloneSettings.rev" which you'll find in the Toolset subdirectory of your Revolution installation. Save stack "revSaveAsStandalone" after you've modified it, and build your standalone.
The upside of this approach is that it will automatically apply to all standalones that you build with that version of Revolution. The downside is that you'll have to apply that change every time a new version of Revolution comes along.
So overall, you may prefer to submit an enhancement request, rather than do the cusomization as described above. It sounds like something that wouldn't be too hard for them to include, and it would benefit everyone.
HTH,
Jan Schenkel.
Posted: Tue Dec 23, 2008 10:02 am
by paulclaude
Thank you very much, Jan. I will try this approach, and I will also submit an enhancement request.
