Metadata error(3)


Jump to: navigation, search



MetadataError - Metadata object error facility


#include "Metadata.h"
using namespace SEISPP;
class MetadataError
class MetadataGetError : public MetadataError
class MetadataParseError : public MetadataError


Contributed: NO BRTT support -- please contact author.


The set of MetadataError objects are companions to the variable length header concept Metadata(3) object. Some of the metadata object functions will throw MetadataError or the derived classes listed in the Synopsis. Error handlers can be written to trap these exceptions using real time type checking to sort out which actual type is thrown (see classic books by Stoustrup or other books on C++ for examples).

A MetadataError is a generic error object that contains little more than an error message that can be sent to stderr using a function called log_error().

The derived classes MetadataGetError and MetadataParseError are more specific. A MetadataGetError may be thrown by any of the "get" metadata functions. The most common reason is that the parameter with the requested name either did not exist in the metadata object or there was a type mismatch. The assumption is that a handler need only know that the get process failed and it should give the user feedback on why it might have failed. Hence, it contains only an extended message facility to dump the error message using the log_error() function.

The MetadataParseError function is implementation specific. The metadata object as currently defined uses an Antelope Pf "object" to store the abstract concept I've called "metadata." A MetadataParseError is thrown by metadata constructors when a parameter file or string used to build the Pf fails on a pfcompile error. A MetadataParseError object thus contains the log_error() function plus an integer variable called error_code that contains the error code from pfcompile.






This is a fairly simple error object definition. It might evolve as time goes on.


Gary L. Pavlis
Indiana University
Antelope Contributed Software
Last Modified 2012-03-15