Re: Catching an error when the result is vital



Synic <flavp+hfrarg@xxxxxxxxxxxxx> wrote:
> Bryan Oakley <oakley@xxxxxxxxxxxxxxxxxxxx> wrote:
>> Exactly what happens when you run the following code:
>>
>> if {[catch {::mysql::connect ...} result]} {
>> puts "caught an error: $result"
>> } else {
>> puts "didn't catch an error: $result"
>> set LINK $result
>> }
>
> Tried just then using the code above.
>
> Same result as before:
>
> ::mysql::connect/db server: Can't connect to MySQL server on
> 'foo.bar.com' (10061) while executing
> "::mysql::connect -user foo -password bar -host foo.bar.com -db foo
> -port 5506 -compress true" (procedure "Init" line 4) invoked from
> within [...]
>
> From that dialog titled "Error in startup script".

Just to confirm from the other direction... When running the script
while the MySQL server is up, I get the message:

didn't catch an error: mysql1

Then the app runs happily with its connection being alive.
.



Relevant Pages

  • Trying to get started with sdx...
    ... This afternoon I downloaded tclkit and sdx from equi4.com. ... ("package ifneeded" script) ... Anyway my app is structured like: ... Main-Dir contains a startup script Foo.tcl ...
    (comp.lang.tcl)
  • Re: Startup Application
    ... Startup Script for this app? ... I searched the net and found all these tools for writing scripts along with ... the Windows login screen comes up. ... Have you tried to run the application from a Machine Startup Script? ...
    (microsoft.public.windows.server.setup)
  • Re: Using WMI to correctly identify the current user on a remote s
    ... > task and that I'll be forced to launch an external 3rd-party app to ... you could have a startup script run which could log the username ...
    (microsoft.public.scripting.wsh)
  • Re: Startup Application
    ... Startup Script for this app? ... the Windows login screen comes up. ...
    (microsoft.public.windows.server.setup)
  • How can I determine if a user is logged in to a WinXP box with RDP?
    ... If the user is logged in with the Remote Desktop Connection, the startup script should not start the process. ... In concrete, I need PowerStrip to be started, when I'm sitting on my desktop machine, because the CRT has it's best view with 80 Hz, but the graphics adapter will only allow 75 Hz und 85 Hz. ... When I connect to the box with RDP, i will get an error message, that the parameters will be changed. ...
    (microsoft.public.scripting.vbscript)