From 4e6c2251d31ec0c7fe1236df62aa3e1a2797fecb Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 28 Jun 2011 21:01:15 +0200 Subject: Document exceptions --- lib/Travel/Routing/DE/VRR.pm | 14 ++++++-- lib/Travel/Routing/DE/VRR/Exception.pod | 57 +++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 3 deletions(-) create mode 100644 lib/Travel/Routing/DE/VRR/Exception.pod diff --git a/lib/Travel/Routing/DE/VRR.pm b/lib/Travel/Routing/DE/VRR.pm index d486a6e..baa770c 100644 --- a/lib/Travel/Routing/DE/VRR.pm +++ b/lib/Travel/Routing/DE/VRR.pm @@ -768,9 +768,7 @@ The following methods act like the arguments to B. See there. =head1 DIAGNOSTICS When encountering an error, Travel::Routing::DE::VRR returns a -Travel::Routing::DE::VRR::Exception object. - -Dies with a backtrace when anything goes wrong. +Travel::Routing::DE::VRR::Exception(3pm) object. =head1 DEPENDENCIES @@ -788,6 +786,16 @@ The parser is still somewhat fragile and has no proper error handling. It is best not to pass Unicode characters to B. +=head1 SEE ALSO + +=over + +=item * Travel::Status::DE::VRR::Exception(3pm) + +=item * Travel::Status::DE::VRR::Route(3pm) + +=back + =head1 AUTHOR Copyright (C) 2009-2011 by Daniel Friesel Ederf@finalrewind.orgE diff --git a/lib/Travel/Routing/DE/VRR/Exception.pod b/lib/Travel/Routing/DE/VRR/Exception.pod new file mode 100644 index 0000000..3d690ec --- /dev/null +++ b/lib/Travel/Routing/DE/VRR/Exception.pod @@ -0,0 +1,57 @@ +=head1 NAME + +Travel::Routing::DE::VRR::Exception - Travel::Routing::DE::VRR Exceptions + +=head1 DESCRIPTION + +All Exceptions throws by Travel::Routing::DE::VRR::Exception are +Travel::Routing::DE::VRR::Exception objects created by Exception::Class(3pm). + +See Exception::Class::Base(3pm) for their common methods. + +=head1 LIST OF EXCEPTIONS + +=head2 Travel::Routing::DE::VRR::Exception::Setup + +An argument to B had an invalid format. + +Additional methods: + +=over + +=item $exception->option + +The option in which the error occured. + +=item $exception->have + +The argument we got. + +=item $exception->want + +What kind of argument we want. + +=back + +=head2 Travel::Routing::DE::VRR::Exception::Net + +The HTTP request to the efa interface failed. Contains an HTTP::Response(3pm) +object describing the error in B. + +=head2 Travel::Routing::DE::VRR::Exception::NoData + +We got no parsable data from efa.vrr.de + +=head2 Travel::Routing::DE::VRR::Exception::Ambiguous + +Our request contained ambiguous data. B contains the relevant POST +key, B is a comma-separated string of possible key values (as +reported by efa.vrr.de). + +=head2 Travel::Routing::DE::VRR::Exception::NoConnections + +efa.vrr.de found no connections for our request. + +=head1 SEE ALSO + +Travel::Status::DE::VRR(3pm) -- cgit v1.2.3