in reply to Re^2: STDERR in Test Results
in thread STDERR in Test Results
Update: Problem already found in Re^4: STDERR in Test Results.
Both tests pass but I still get the output to STDERR when the process method is called. I guess I'm just looking for a way to suppress the output...
Or perhaps for a place where someone prints to STDERR or warns.
Looking at B::S::W 1.11 at CPAN, B::S::W::process() calls $self->_error() with the error message shown. And now look at that method:
sub _error { my ($self, $message) = @_; $self->{'error'} = $message; if (defined &{$self->{'error'}}) { &{$self->{'error'}}($message); } else { STDERR->print("Stripe Webhook Error: $message\n"); } }
That's why you shall use warn and die instead of printing to STDERR. sub _warning has the same problem.
Oh, by the way: eval catches errors, not warnings, so your variable would be better named $got_error instead of $got_warn.
Alexander
|
|---|