-
-
20 Jul 2017 20:27:52 UTC
- Distribution: Net-Fritz
- Module version: v0.0.9
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Repository
- Issues (2)
- Testers
- Kwalitee
Bus factor: 0- License: gpl_2
- Perl: v5.6.0
- Activity
24 month- Tools
- Download (34.69KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- NAME
- VERSION
- SYNOPSIS
- DESCRIPTION
- ATTRIBUTES (read-only)
- METHODS
- SEE ALSO
- AUTHOR
- COPYRIGHT AND LICENSE
NAME
Net::Fritz::IsNoError - a Moo::Role discerning all other Net::Fritz objects from a Net::Fritz::Error object
VERSION
version v0.0.9
SYNOPSIS
$root_device = Net::Fritz::Box->new->discover; $root_device->errorcheck;
or
$root_device = Net::Fritz::Box->new->discover; if ($root_device->error) { die "error: " . $root_device->error; }
DESCRIPTION
All valid (non-error) Net::Fritz classes do the Net::Fritz::IsNoError role, the only exception being of course) Net::Fritz::Error. All Net::Fritz objects thus support
error
anderrorcheck
If you want your code to just
die()
on any error, call$obj->errorcheck
on every returned object (see first example above).If you just want to check for an error and handle it by yourself, call
$obj->error
. All non-errors will return0
(see second example above).You don't have to check for errors at all, but then you might run into problems when you want to invoke methods on an Net::Fritz::Error object that don't exist (because you expected to get eg. an Net::Fritz::Service object instead).
ATTRIBUTES (read-only)
error
Returns an empty string to pass any
if($obj->error) { ... }
checks.METHODS
errorcheck
A no-op, so that calling
$obj->errorcheck
just succeeds and carries on.SEE ALSO
See Net::Fritz for general information about this package, especially "INTERFACE" in Net::Fritz for links to the other classes.
AUTHOR
Christian Garbs <mitch@cgarbs.de>
COPYRIGHT AND LICENSE
Copyright (C) 2017 Christian Garbs
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Module Install Instructions
To install Net::Fritz, copy and paste the appropriate command in to your terminal.
cpanm Net::Fritz
perl -MCPAN -e shell install Net::Fritz
For more information on module installation, please visit the detailed CPAN module installation guide.