From 6ec02023f1dc55dd1c9b958dfda88ab50bf19063 Mon Sep 17 00:00:00 2001 From: ilor <kailoran@gmail.com> Date: Wed, 22 Sep 2010 14:18:35 +0200 Subject: [PATCH] add exception scope info --- libcorpus2/CMakeLists.txt | 3 --- libcorpus2/exception.cpp | 6 ++++++ libcorpus2/exception.h | 3 +++ libpwrutils/exception.cpp | 5 +++++ libpwrutils/exception.h | 3 +++ 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/libcorpus2/CMakeLists.txt b/libcorpus2/CMakeLists.txt index c0554e4..424099b 100644 --- a/libcorpus2/CMakeLists.txt +++ b/libcorpus2/CMakeLists.txt @@ -16,9 +16,6 @@ set(LIBCORPUS2_DATA_DIR set(LIBCORPUS2_VERSION "${corpus2_ver_major}.${corpus2_ver_minor}.${corpus2_ver_patch}") - -MESSAGE(${LIBCORPUS2_DATA_DIR}) - configure_file(config_d.in include/libcorpus2/config_d.h) configure_file(version.in include/libcorpus2/version.h) include_directories(${CMAKE_CURRENT_BINARY_DIR}/include/) diff --git a/libcorpus2/exception.cpp b/libcorpus2/exception.cpp index 96e7448..87fd2ec 100644 --- a/libcorpus2/exception.cpp +++ b/libcorpus2/exception.cpp @@ -12,6 +12,11 @@ namespace Corpus2 { { } + std::string Corpus2Error::scope() const + { + return "Corpus2"; + } + FileNotFound::FileNotFound(const std::string& filename, const std::string& paths, const std::string& where) : Corpus2Error("File not found: " + filename), filename(filename), @@ -35,4 +40,5 @@ namespace Corpus2 { return ss.str(); } + } /* end ns Corpus2 */ diff --git a/libcorpus2/exception.h b/libcorpus2/exception.h index ab443b7..a68a507 100644 --- a/libcorpus2/exception.h +++ b/libcorpus2/exception.h @@ -20,6 +20,9 @@ public: Corpus2Error(const std::string &what); ~Corpus2Error() throw(); + + /// PwrNlpError override + std::string scope() const; }; class FileNotFound : public Corpus2Error diff --git a/libpwrutils/exception.cpp b/libpwrutils/exception.cpp index f500c11..1efff59 100644 --- a/libpwrutils/exception.cpp +++ b/libpwrutils/exception.cpp @@ -32,4 +32,9 @@ std::string PwrNlpError::info() const return what(); } +std::string PwrNlpError::scope() const +{ + return "general"; +} + } /* end ns PwrNlp */ diff --git a/libpwrutils/exception.h b/libpwrutils/exception.h index 5ad8a4d..8569a8a 100644 --- a/libpwrutils/exception.h +++ b/libpwrutils/exception.h @@ -41,6 +41,9 @@ public: /// verbose-info function virtual std::string info() const; + + /// scope information (subproject-like) + virtual std::string scope() const; }; } /* end ns PwrNlp */ -- GitLab