in reply to Are their Documented Default Exit Codes for Certain Modules?

Hey guys, I'm just doing a Comment on the original post so I respond to all in one...

Thanks for the replies!

thezip,

Yea, I did check out the source code a few times but I couldn't find any specific error message that
it prints... So now I'm thinking that it may actually get the errors from the OS if that's possible, but
I'm not sure...

Anonymous Monk, thanks for the reply, but I know 0 is no error and non-zero is an error lol... But you did
help me solve this problem by replying in my other post I talk about below... So thanks!

FloydATC, thanks for the reply!

Yea, I TOTALLY agree, that's kinda why I wanted to see what the other possible error messages could be...
I had only been able so far to come across 2 error messages while debugging/testing my script.

But basically, my plan from the beginning was to capture the error message and Return Code and display it "AS IS"
inside a Gtk2 'DialogBox'. But since the script I'm executing is ran in the background using the Perl Module
Proc::Background I couldn't figure out a way to 'capture' the STDOUT/STDERR in order to display it.
So my plan was to try and find as many of the Return Codes as I could and use the "Return Codes" inside a switch
statement and match them up with what their actual error messages would be... So if for example the return code was
'113' then I would print out "No route to host" which is what I get when I see Return Code == '113'. But I guess that
would definitely NOT be a very reliable method to use...

I did have a post open here comment on where I was asking about capturing STDOUT/STDERR from a Process that's running
in the background, and after I got a reply from "Anonymous Monk" I came to realize something, and I feel REALLY dumb that
I didn't think of it already... Since the background process that I need to capture any error codes and messages from is a
script that I wrote, I can just add something in there to print to a log-like file and capture it there instead of printing to
STDOUT since you'd never see that anyway as the user. So, if for example, the Return Code is NOT equal to 'ZERO' then print the
error message to a file and read the file in the calling script...


So I guess that solves BOTH issues with this. I'll just go back to my "background" script and add that stuff to it...


Thanks again guys for your replies. Very much appreciated!


Thanks AGAIN,
Matt

  • Comment on Re: Are their Documented Default Exit Codes for Certain Modules?