Skip Menu |

This queue is for tickets about the WebService-HIBP CPAN distribution.

Report information
The Basics
Id: 129297
Status: resolved
Priority: 0/
Queue: WebService-HIBP

People
Owner: Nobody in particular
Requestors: meldrum [...] osisecurity.com.au
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.13



Subject: unbreached accounts should not result in an error being thrown
Date: Wed, 24 Apr 2019 11:37:29 +1000
To: bug-webservice-hibp [...] rt.cpan.org
From: Matthew Meldrum <meldrum [...] osisecurity.com.au>
Explanation: If you are checking accounts, and an email address is not breached, this returns a 404 from the site. WebService::HIBP treats this as an error. If I am checking a lot of accounts, I would prefer it if WebService::HIBP returned an empty list of breaches instead of throwing an error? Or some other way to handle a non-hit other than Carp::Croak(). to reproduce: foreach my $breach ($hibp->account("this-account_does_not_exist_in\@hibp.com")) { push(@sites,$breach->title()); } If I am in error, could you be so kind as to explain how to handle non-hit results? Thanks, Matthew
On Wed Apr 24 11:21:46 2019, meldrum@osisecurity.com.au wrote: Show quoted text
> Explanation: > If you are checking accounts, and an email address is not breached, > this > returns a 404 from the site. WebService::HIBP treats this as an error. > If I > am checking a lot of accounts, I would prefer it if WebService::HIBP > returned an empty list of breaches instead of throwing an error? Or > some > other way to handle a non-hit other than Carp::Croak().
Indeed. I've released 0.13 to return empty lists or undef, depending on the method.