- if ($this->option("_check_debug")) {
- print STDERR "ZOOM WARNING! $this->check() failed with error $diagset:$errcode ($errmsg) $addinfo\n";
- print STDERR "SIG{SEGV} ", (defined $SIG{SEGV} ? ("= '" . $SIG{SEGV} . "'") : "undefined"), "'\n";
- print STDERR "SIG{__DIE__} ", (defined $SIG{__DIE__} ? ("= '" . $SIG{__DIE__} , "'") : "undefined"), "'\n";
+ my $exception = new ZOOM::Exception($errcode, $errmsg, $addinfo,
+ $diagset);
+ if (!$this->option("async") || $always_die_on_error) {
+ ZOOM::Log::log("zoom_check", "throwing error $exception");
+ die $exception;
+ } else {
+ ZOOM::Log::log("zoom_check", "not reporting error $exception");