GeographicLib 2.1.2
GeographicLib::GeographicErr Class Reference

Exception handling for GeographicLib. More...

#include <GeographicLib/Constants.hpp>

Inheritance diagram for GeographicLib::GeographicErr:

Public Member Functions

 GeographicErr (const std::string &msg)
 

Detailed Description

Exception handling for GeographicLib.

A class to handle exceptions. It's derived from std::runtime_error so it can be caught by the usual catch clauses.

Example of use:

// Example of using the GeographicLib::GeographicErr class
#include <iostream>
using namespace std;
using namespace GeographicLib;
int main() {
try {
throw GeographicErr("Test throwing an exception");
}
catch (const GeographicErr& e) {
cout << "Caught exception: " << e.what() << "\n";
}
}
int main(int argc, const char *const argv[])
Definition: CartConvert.cpp:29
Header for GeographicLib::Constants class.
Exception handling for GeographicLib.
Definition: Constants.hpp:316
GeographicErr(const std::string &msg)
Definition: Constants.hpp:325
Namespace for GeographicLib.
Definition: Accumulator.cpp:12

Definition at line 316 of file Constants.hpp.

Constructor & Destructor Documentation

◆ GeographicErr()

GeographicLib::GeographicErr::GeographicErr ( const std::string &  msg)
inline

Constructor

Parameters
[in]msga string message, which is accessible in the catch clause via what().

Definition at line 325 of file Constants.hpp.


The documentation for this class was generated from the following file: