Gyoto
Classes | Namespaces | Typedefs | Functions
GyotoError.h File Reference

Error handling. More...

#include <string>

Go to the source code of this file.

Classes

class  Gyoto::Error
 Class for thowing exceptions. More...

Namespaces

namespace  Gyoto
 Namespace for the Gyoto library.

Typedefs

typedef void GyotoErrorHandler_t (const char *)

Functions

void Gyoto::setErrorHandler (GyotoErrorHandler_t *)
void Gyoto::throwError (std::string)

Detailed Description

Error handling.

Every Gyoto method should check for possible error conditions and throw adequate Gyoto::Error exceptions. For instance:

if (error_condition) throw Gyoto::Error("Useful error message");

The main code can then catch these exceptions and act appropriately, for instance:

try { gyoto_code ; }
catch (Gyoto::Error err)
{
err.Report();
abort();
}