Net::Mailboxlayer::Error - Encapsulates an error response from's REST API.


 use Net::Mailboxlayer;

 my $mailboxlayer = Net::Mailboxlayer->new(access_key => 'YOUR_ACCESS_KEY', email_address => '');
 my $result = $mailboxlayer->check;

 if ($result->has_error)
   # $result is a F<Net::Mailboxlayer::Error> object.
   print "There was an error: ". $result->info . "\n";


You would not normally be calling this module directly, it is one of the possible return objects from a call to Net::Mailboxlayer's check method.

The errors provided are developer oriented, you probably don't want to pass them onto your users.

For API errors, see the official docs ( for more information.

It is also possible that the errors are generated from $user_agent->get(), so you may also want to see the HTTP::Response documentation.


Returns a new Net::Mailboxlayer::Error object.


This is a convenience method that allows you to determine if the result object had an error or not. For this module if will always be 1 (true).


This is always set to 0 for the Net::Mailboxlayer::Error object, but it is not available in the Net::Mailboxlayer::Response object. has_error is the preferred way to check for success.

 print $response->success; # 0


An internal error type.


A short text description of the error which may contain suggestions.


The numeric code of the API Error. In addition to the API errors, you can also get errors from your useragent


Provides access to the return value of $user_agent->get(). In typical usage, this would be a HTTP::Response object. You do not normally need to access this.

 print $result->response->decoded_content; # prints the JSON return from the api call.


Tom Heady <>


Copyright 2016 Tom Heady.

This program is free software; you can redistribute it and/or modify it under the terms of either:

  • the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or

  • the Artistic License.