Class File_MARC_Exception

Description

The File_MARC_Exception class enables error-handling for the File_MARC package.

Located in /MARC/Exception.php (line 49)

PEAR_Exception
   |
   --File_MARC_Exception
Class Constant Summary
Variable Summary
static mixed $messages
Method Summary
static string formatError (string $message, array $errorValues)
Variables
static mixed $messages = array(
self::ERROR_EMPTY_SUBFIELD => 'No subfield data found in tag "%tag%"',
self::ERROR_FIELD_EOF => 'Field for tag "%tag%" does not end with an end of field character',
self::ERROR_INCORRECT_LENGTH => 'Invalid record length: Leader says "%record_length%" bytes; actual record length is "%actual%"',
self::ERROR_INSERTFIELD_MODE => 'insertField() mode "%mode%" was not recognized',
self::ERROR_INSERTSUBFIELD_MODE => 'insertSubfield() mode "%mode%" was not recognized',
self::ERROR_INVALID_DIRECTORY => 'Directory entry for tag "%tag%" runs past the end of the record',
self::ERROR_INVALID_DIRECTORY_LENGTH => 'Invalid directory length',
self::ERROR_INVALID_DIRECTORY_OFFSET => 'Invalid offset "%offset%" for tag "%tag%" in directory',
self::ERROR_INVALID_DIRECTORY_TAG => 'Invalid tag "%tag%" in directory',
self::ERROR_INVALID_DIRECTORY_TAG_LENGTH => 'Invalid length "%len%" in directory for tag "%tag%"',
self::ERROR_INVALID_FIELD => 'Specified field must be a File_MARC_Data_Field or File_MARC_Control_Field object, but was "%field%"',
self::ERROR_INVALID_FILE => 'Invalid input file "%filename%"',
self::ERROR_INVALID_INDICATOR_REQUEST => 'Attempt to access indicator "%indicator%" failed; 1 and 2 are the only valid indicators',
self::ERROR_INVALID_INDICATORS => 'Invalid indicators "%indicators%" forced to blanks for tag "%tag%"',
self::ERROR_INVALID_SOURCE => "Invalid source for MARC records",
self::ERROR_INVALID_SUBFIELD => 'Specified field must be a File_MARC_Subfield object, but was "%class%"',
self::ERROR_INVALID_TAG => 'Tag "%tag%" is not a valid tag.',
self::ERROR_INVALID_TERMINATOR => 'Invalid record terminator',
self::ERROR_MISSING_LENGTH => "Couldn't find record length",
self::ERROR_NO_DIRECTORY => 'No directory found',
self::ERROR_NONNUMERIC_LENGTH => 'Record length "%record_length%" is not numeric',
self::ERROR_INVALID_INDICATOR => 'Illegal indicator "%indicator%" in field "%tag%" forced to blank',
)
(line 163)
  • access: public
Methods
static method formatError (line 201)

Replaces placeholder tokens in an error message with actual values.

This method enables you to internationalize the messages for the File_MARC class by simply replacing the File_MARC_Exception::$messages array with translated values for the messages.

  • return: Formatted message
  • access: public
static string formatError (string $message, array $errorValues)
  • string $message: Error message containing placeholders
  • array $errorValues: Actual values to substitute for placeholders
Class Constants
ERROR_EMPTY_SUBFIELD = -12 (line 109)

A subfield is defined, but has no data

ERROR_FIELD_EOF = -10 (line 99)

A field does not end with the expected end-of-field character

ERROR_INCORRECT_LENGTH = -18 (line 139)

The length in the MARC leader does not match the actual record length

ERROR_INSERTFIELD_MODE = -14 (line 119)

An invalid mode for adding a field was specified

ERROR_INSERTSUBFIELD_MODE = -17 (line 134)

An invalid mode for adding a subfield was specified

ERROR_INVALID_DIRECTORY = -9 (line 94)

An entry in the MARC directory runs past the end of the record

ERROR_INVALID_DIRECTORY_LENGTH = -5 (line 74)

An entry in the MARC directory was not 12 bytes

ERROR_INVALID_DIRECTORY_OFFSET = -8 (line 89)

An entry in the MARC directory specified an invalid field offset

ERROR_INVALID_DIRECTORY_TAG = -6 (line 79)

An entry in the MARC directory specified an invalid tag

ERROR_INVALID_DIRECTORY_TAG_LENGTH = -7 (line 84)

An entry in the MARC directory specified an invalid tag length

ERROR_INVALID_FIELD = -15 (line 124)

An invalid object was passed instead of a File_MARC_Field object

ERROR_INVALID_FILE = -1 (line 54)

File could not be opened

ERROR_INVALID_INDICATOR = -22 (line 159)

A field has invalid indicators

ERROR_INVALID_INDICATORS = -11 (line 104)

A field has invalid indicators

ERROR_INVALID_INDICATOR_REQUEST = -13 (line 114)

An indicator other than 1 or 2 was requested

ERROR_INVALID_SOURCE = -2 (line 59)

User passed an unknown SOURCE_ constant

ERROR_INVALID_SUBFIELD = -16 (line 129)

An invalid object was passed instead of a File_MARC_Subfield object

ERROR_INVALID_TAG = -21 (line 154)

Tag does not adhere to MARC standards

ERROR_INVALID_TERMINATOR = -3 (line 64)

MARC record ended with an invalid terminator

ERROR_MISSING_LENGTH = -19 (line 144)

The length field in the leader was less than five characters long

ERROR_NONNUMERIC_LENGTH = -20 (line 149)

A five-digit length could not be found in the MARC leader

ERROR_NO_DIRECTORY = -4 (line 69)

No directory was found for the MARC record

Documentation generated on Mon, 01 Jan 2007 23:44:41 -0500 by phpDocumentor 1.3.1