02-06-2002
converting a signal to a C++ exception
I am trying to imitate a system call available on Win32
(spit). The functionality is to catch a system exception (i.e. signal)
such as divide-by-zero, and convert it to a catchable c++
exception. Can this be done on Unix ?
Can i use "throw new <ExcpetionClass>" inside a
signal-handling routine ?
I am using AIX.
Thank you for your time
Seeker
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Does exception handling exist in any UNIX enviornment? I develop on Windows MSVC++ land and need to port to UNIX. (1 Reply)
Discussion started by: RichardS
1 Replies
2. UNIX for Advanced & Expert Users
Hi, I am trying to use swremove to remove some old software packages before an upgrade. I keep getting the same error below. I have restarted swagent, i have killed the swagent process and started it, and I have restarted the entire system. I have now run out of ideas. Anyone know what the problem... (0 Replies)
Discussion started by: ejbrever
0 Replies
3. HP-UX
Hi, I am trying to use swremove to remove some old software packages before an upgrade. I keep getting the same error below. I have restarted swagent, i have killed the swagent process and started it, and I have restarted the entire system. I have now run out of ideas. Anyone know what the problem... (2 Replies)
Discussion started by: ejbrever
2 Replies
4. UNIX for Dummies Questions & Answers
Dear friends,
I am transferring some files to a windows system from Unix m/c thru FTP Script given below.
echo "open $host
quote USER $userid
quote PASS $pwd
$verbose
$type
cd $dir
bin
put $file
close
quit"|$ftp... (0 Replies)
Discussion started by: Vijayakumarpc
0 Replies
5. Programming
Hi,
when i compile my java code in UNIX using javac, the class file is getting created. But when i try to run the code using java - classpath command, i get the following error.
----------------------------------------
/u/up11/sample/request:>java -classpath /u/up11/sample/request... (0 Replies)
Discussion started by: satish2712
0 Replies
6. Shell Programming and Scripting
Hi,
I am trying to understand the significance of the special variables $!,$@ and $? in perl. I have a code block as follows:
eval {
Code Segment 1:
#authenticating to the remote server
$ftpobj -> login($username,$password) or die "Can't login to $remote_host";
... (12 Replies)
Discussion started by: DILEEP410
12 Replies
7. Shell Programming and Scripting
Hi,
I have written a script to load csv files into a mysql database, however, i would like for the shell script to exit in the event of an error (missing file, load error etc.) - currently if an error is encountered the next statement is processed - This is how i am loading the csv scripts
... (5 Replies)
Discussion started by: bertpereira
5 Replies
8. Shell Programming and Scripting
Sometimes when I try to use curl to upload to an ftp server, I get the message:
$curl -T file.wmv ftp.eu.filesonic.com --user user:password
curl: (8) Got a 421 ftp-server response when 220 was expected
How do I get the script to try again if I get the message curl: (8)? (2 Replies)
Discussion started by: locoroco
2 Replies
9. Shell Programming and Scripting
I have following file:
NAME=ora.DG1.svc
TYPE=ora.service.type
CARDINALITY_ID=1
TARGET=ONLINE
STATE=ONLINE
NAME=ora.orlene.DG2.svc
TYPE=ora.service.type
CARDINALITY_ID=1
TARGET=ONLINE
STATE=OFFLINE
NAME=ora.MN.acfs
TYPE=ora.registry.acfs.type
TARGET=ONLINE (4 Replies)
Discussion started by: rcc50886
4 Replies
10. Shell Programming and Scripting
Hi Folks,
please advise , I have logs generated on unix machine at location /ops/opt/aaa/bvg.log , now sometimes there come exception in these logs also, so I want to write such a script such that it should continuously monitor these logs and whenever any exception comes that is it try to find... (3 Replies)
Discussion started by: tuntun27272727
3 Replies
LEARN ABOUT DEBIAN
dancer::exception::base
Dancer::Exception::Base(3pm) User Contributed Perl Documentation Dancer::Exception::Base(3pm)
NAME
Dancer::Exception::Base - the base class of all Dancer exceptions
DESCRIPTION
Dancer::Exception::Base is the base class of all Dancer exception. All core exceptions, and all custom exception registered using
"Dancer::Exception::register_exception" inherits of "Dancer::Exception::Base".
METHODS
throw
Throws an exception. It's what "raise" (from Dancer::Exception) uses. Any arguments is set as raising parameters. You should not use this
method directly, but instead, use "raise" from Dancer::Exception.
Warning, if you want to rethrow an exception, use "rethrow".
rethrow
Re-throw the exception, without touching its parameters. Useful if you've caught and exception but don't want to handle it, and want to
rethrow it.
try { ... }
catch {
my ($e) = @_;
$e->does('InvalidLogin')
or $e->rethrow;
...
};
does
Given an exception type, returns true if the exception is of the same type.
try { raise InvalidLogin => 'foo'; }
catch {
my ($e) = @_;
$e->does('InvalidLogin') # true
...
};
It can receive more than one type, useful for composed exception, or checking multiple types at once. "does" performs a logical OR between
them:
try { raise InvalidPassword => 'foo'; }
catch {
my ($e) = @_;
$e->does('InvalidLogin', 'InvalidPassword') # true
...
};
get_composition
Returns the composed types of an exception. As every exception inherits of Dancer::Exception::Base, the returned list contains at least
'Base', and the exception class name.
Warning, the result is a list, so you should call this method in list context.
try { raise InvalidPassword => 'foo'; }
catch {
my ($e) = @_;
my @list = $e->get_composition()
# @list contains ( 'InvalidPassword', 'Base', ... )
};
message
Computes and returns the message associated to the exception. It'll apply the parameters that were set at throw time to the message pattern
of the exception.
STRINGIFICATION
string overloading
All Dancer exceptions properly stringify. When evaluated to a string, they return their message, concatenated with their stack trace (see
below).
cmp overloading
The "cmp" operator is also overloaded, thus all the string operations can be done on Dancer's exceptions, as they will all be based on the
overloaded "cmp" operator. Dancer exceptions wil be compared without their stacktraces.
STACKTRACE
Similarly to Carp, Dancer exceptions stringification appends a string stacktrace to the exception message.
The stacktrace can be a short one, or a long one. Actually the implementation internally uses Carp.
To enable long stack trace (for debugging purpose), you can use the global variable "Dancer::Exception::Verbose" (see below).
The short and long stacktrace snippets are stored within "$self-"{_shortmess}> and "$self-"{_longmess}>. Don't touch them or rely on them,
they are internals, and will change soon.
GLOBAL VARIABLE
$Dancer::Exception::Verbose
When set to 1, exceptions will stringify with a long stack trace. This variable is similar to $Carp::Verbose. I recommend you use it like
that:
local $Dancer::Exception::Verbose;
$Dancer::Exception::Verbose = 1;
All the Carp global variables can also be used to alter the stacktrace generation.
perl v5.14.2 2012-03-31 Dancer::Exception::Base(3pm)