pure perl and c# - catch errors when executing script
by Dan Jablonsky other posts by this author
Feb 17 2005 9:43AM messages near this date
view in the new Beta List Site
Unable to build a dll project.
|
Re: pure perl and c# - catch errors when executing script
FRAMEWORK Hi all,
i have the following code in a c# application:
public void execscript()
{
Process myprocess = new Process();
try
{
string perl_script = "err0.pl";
myprocess.StartInfo.FileName "c:\\perl_dev\\" +
perl_script;
myprocess.StartInfo.CreateNoWindow = false;
myprocess.StartInfo.WindowStyle =
ProcessWindowStyle.Maximized;
myprocess.StartInfo.UseShellExecute = true;
myprocess.Start();
myprocess.WaitForExit(10000);
EventLog.WriteEntry("exterr", "test mesg");
myprocess.Close();
}
catch (Exception e)
{
throw new System.Exception();
}
}
I need to catch an error raised in the script.
Right now the script contains only one line:
#!perl
die("died here");
Unfortunatelly, I can catch an error like "file not
found", "no permission" BUT I CANNOT CATCH THE die().
I tried to replace die with exit(255) and I tried to
execute something that would definetely issue an error
from Perl - nothing worked.
Any idea how to do it?
Thanks,
Dan
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
Perl.NET mailing list
Perl.NET@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Dan Jablonsky
Dan Jablonsky
|