[rt-users] Suppressing method error messages

Mike Friedman mikef at ack.Berkeley.EDU
Thu Oct 21 16:31:57 EDT 2004


Is there an easy way, in a perl script, to suppress error messages written
by RT methods to STDERR?  For example, inside a loop, I have something
like this:

  $TicketNumber = $TicketObj->Load($i);
  next unless (defined $TicketNumber);

but if ticket number '$i' doesn't exist, I get an ugly message from the
Ticket->Load method:

  [crit]: RT::Ticket=HASH(0x8c89988) tried to load a bogus ticket:

when all I want to do is continue without printing anything.  (In general,
redirecting STDERR to /dev/null is not feasible, since I may want to write
my own messages there and have them seen).

Thanks.

Mike

------------------------------------------------------------------------------
Mike Friedman                             System and Network Security
mikef at ack.Berkeley.EDU                    2484 Shattuck Avenue
1-510-642-1410                            University of California at Berkeley
http://ack.Berkeley.EDU/~mikef            http://security.berkeley.edu
------------------------------------------------------------------------------



More information about the rt-users mailing list