summaryrefslogtreecommitdiff
path: root/error.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-08-03 04:34:50 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 02:40:47 -0400
commita32173ace60df5a1e9414f5e95b556c436f62718 (patch)
treefff5b881c657fddb8543b0f787bfa75cf009a0b7 /error.h
parentcc98b59d1e99238270eb307b117da8b0b35e6f27 (diff)
downloadfork-ledger-a32173ace60df5a1e9414f5e95b556c436f62718.tar.gz
fork-ledger-a32173ace60df5a1e9414f5e95b556c436f62718.tar.bz2
fork-ledger-a32173ace60df5a1e9414f5e95b556c436f62718.zip
changes
Diffstat (limited to 'error.h')
-rw-r--r--error.h65
1 files changed, 0 insertions, 65 deletions
diff --git a/error.h b/error.h
deleted file mode 100644
index 52af358a..00000000
--- a/error.h
+++ /dev/null
@@ -1,65 +0,0 @@
-#ifndef _ERROR_H
-#define _ERROR_H
-
-#include "journal.h"
-
-#include <exception>
-#include <string>
-#include <sstream>
-
-namespace ledger {
-
-class error : public std::exception {
- std::string reason;
- public:
- error(const std::string& _reason) throw() : reason(_reason) {}
- virtual ~error() throw() {}
-
- virtual const char* what() const throw() {
- return reason.c_str();
- }
-};
-
-class compute_error : public error {
- public:
- compute_error(const std::string& reason) throw() : error(reason) {}
- virtual ~compute_error() throw() {}
-};
-
-class value_expr_error : public error {
- public:
- value_expr_error(const std::string& reason) throw() : error(reason) {}
- virtual ~value_expr_error() throw() {}
-};
-
-class interval_expr_error : public error {
- public:
- interval_expr_error(const std::string& reason) throw() : error(reason) {}
- virtual ~interval_expr_error() throw() {}
-};
-
-class format_error : public error {
- public:
- format_error(const std::string& reason) throw() : error(reason) {}
- virtual ~format_error() throw() {}
-};
-
-class parse_error : public error {
- unsigned int line;
- std::string file;
- public:
- parse_error(const std::string& _file, const unsigned int _line,
- const std::string& reason) throw()
- : error(reason), line(_line), file(_file) {}
- virtual ~parse_error() throw() {}
-
- virtual const char* what() const throw() {
- std::ostringstream msg;
- msg << file << ", line " << line << ": " << error::what();
- return msg.str().c_str();
- }
-};
-
-} // namespace ledger
-
-#endif // _ERROR_H