2013-05-14 05:54:50 +02:00
< ? php
class OAI2Exception extends Exception {
2013-05-15 04:27:55 +02:00
function __construct ( $code ) {
2013-05-14 05:54:50 +02:00
$this -> errorTable = array (
'badArgument' => array (
2013-05-15 04:27:55 +02:00
'text' => " The request includes illegal arguments, is missing required arguments, includes a repeated argument, or values for arguments have an illegal syntax. " ,
2013-05-14 05:54:50 +02:00
),
'badResumptionToken' => array (
2013-05-15 04:27:55 +02:00
'text' => " The value of the resumptionToken argument is invalid or expired " ,
2013-05-14 05:54:50 +02:00
),
'badVerb' => array (
2013-05-15 04:27:55 +02:00
'text' => " Value of the verb argument is not a legal OAI-PMH verb, the verb argument is missing, or the verb argument is repeated. " ,
2013-05-14 05:54:50 +02:00
),
'cannotDisseminateFormat' => array (
2013-05-15 04:27:55 +02:00
'text' => " The metadata format identified by the value given for the metadataPrefix argument is not supported by the item or by the repository. " ,
2013-05-14 05:54:50 +02:00
),
'idDoesNotExist' => array (
2013-05-15 04:27:55 +02:00
'text' => " The value of the identifier argument is unknown or illegal in this repository. " ,
2013-05-14 05:54:50 +02:00
),
'noRecordsMatch' => array (
2013-05-15 04:27:55 +02:00
'text' => 'The combination of the values of the from, until, set and metadataPrefix arguments results in an empty list.' ,
2013-05-14 05:54:50 +02:00
),
'noMetadataFormats' => array (
'text' => 'There are no metadata formats available for the specified item.' ,
),
'noSetHierarchy' => array (
2013-05-15 04:27:55 +02:00
'text' => 'The repository does not support sets.' ,
2013-05-14 05:54:50 +02:00
),
);
2013-05-14 21:46:15 +02:00
parent :: __construct ( $this -> errorTable [ $code ][ 'text' ]);
$this -> code = $code ;
}
public function getOAI2Code () {
return $this -> code ;
2013-05-14 05:54:50 +02:00
}
}