Replacing default Runtime error msg in packaged image?

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

Replacing default Runtime error msg in packaged image?

Postby AHodges » Wed Feb 20, 2008 4:14 pm

Hi,
I am looking for help in creating a custom exception handler. We build embedded applications for medical instruments. I am trying to replace the default Runtime error message that gets displayed from a packaged image. Rather than displaying a message prompt that says an error occured do you want to continue yes/no, I want to display my own prompter (with no user options to continue, exit, etc) that displays an error message and then effectively locks up the system such that the only option is to cycle power to the intrument.

I have modified the EpRuntimeStartUp reportError:resumable:startBP method to replace the System confirm: with one on my own message prompters and this seems to work. Although I do notice the mouse cursor is still active. And I am concerned about leaving other Smalltalk processes still running.

So, first, is there a better way to install a customized default exception handler for a packaged image, other than directly modifying the EpRuntimStartUp class? I was looking at setting an errorReporter somewhere but have not found how to set an errorReporter for a packaged image.

Second, what is a good way to effectively shutdown Smalltalk without doing a System exit? I still want my error message to be displayed until the intrument is powered off, but I want to lock up the system from anything else happening?

As, usual, thanks in advance for any ideas.
Andy
AHodges
 
Posts: 10
Joined: Tue Nov 14, 2006 9:46 am
Location: Minneapolis, MN

Re: Replacing default Runtime error msg in packaged image?

Postby marten » Thu Feb 21, 2008 1:16 am

AHodges wrote:Hi,
And I am concerned about leaving other Smalltalk processes still running.
...
Second, what is a good way to effectively shutdown Smalltalk without doing a System exit? I still want my error message to be displayed until the intrument is powered off, but I want to lock up the system from anything else happening?


With "Smalltalk processes" you mean normal Smalltalk "green" processes within your crashed Smalltalk image and not
additional Smalltalk images doing some other work ?

Actually I would guess your application needs a startup logic AND a shutdown logic and if you have the latter one one
should simply call the shutdown logic and there you are. On the other hand you could - what a nasty idea - simply write
a non ending loop construct in the foreground process (or a very high priority thread) ... making it impossible for
other threads to become active ....

Marten
Marten Feldtmann, Principal Smalltalk User, Private
SkypeMe callto://marten.feldtmann
marten
[|]
 
Posts: 641
Joined: Sat Oct 14, 2006 7:10 am
Location: Hamburg - Germany

Re: Replacing default Runtime error msg in packaged image?

Postby AHodges » Thu Feb 21, 2008 6:19 am

I am indeed referring to shutting down processes within the crashed image. We actually only have one Smalltalk image running on our instrument, so its the only image we need to worry about.

I had thought about doing something in a high priority thread to essentially block anything else from happening, but this did seem to be an "ugly" solution. I like the shutdown alternative better. So my next question, how do I shutdown short of doing a System exit, which I do not want to do. Is there a way to shut down the "green" processes (as you describe them) within my crashed image without doing a System exit?

Also, any thoughts on how to replace EpRuntimeStartUp class with my own class?
Thanks,
Andy
AHodges
 
Posts: 10
Joined: Tue Nov 14, 2006 9:46 am
Location: Minneapolis, MN

Re: Replacing default Runtime error msg in packaged image?

Postby jtuchel » Thu Feb 21, 2008 6:27 am

[quote="AHodges"]
Also, any thoughts on how to replace EpRuntimeStartUp class with my own class?
[/quote]

Isn't this defined in the packaging rules? Should be easy to change that in the packaged image browser (if you use it)...
jtuchel
[|]
 
Posts: 245
Joined: Fri Oct 05, 2007 1:05 am
Location: Ludwigsburg, Germany

Re: Replacing default Runtime error msg in packaged image?

Postby michael.voss@lvr.de » Wed Feb 27, 2008 2:53 am

Yes, you can subclass EpRuntimeStartUp and use that class as the startUpClassName in your packaging instructions or select it in the packaging control panel. You can overwrite the reportError:resumable:startBP: method (we used System message: 'something' instead of System confirm: 'something' prior to exiting). You'll need an empty startApplication class method in your subclass that gets replaced by the packager at packaging time.
michael.voss@lvr.de
 
Posts: 2
Joined: Wed Feb 27, 2008 2:10 am

Re: Replacing default Runtime error msg in packaged image?

Postby julyaxess » Mon Jul 20, 2009 6:29 am

You build embedded applications for medical instruments and your trying to replace the default Runtime error message that gets displayed from a packaged image.. I guess that is not easy as that right..

________________
Ultrasound repair
julyaxess
 
Posts: 1
Joined: Mon Jul 20, 2009 6:26 am


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest