From: Mikko Rasa Date: Thu, 30 Aug 2012 08:35:53 +0000 (+0300) Subject: Revert "Convenience function for reporting errors in loaded data" X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=011bd4dabaddc6c2739f14a427929bbb6191fea7;p=libs%2Fdatafile.git Revert "Convenience function for reporting errors in loaded data" This reverts commit b0b9af7216560da2a46ea38fe2df959f4dfb126f. Why did I even add this function. The Loader catches any exceptions and rethrows them as data_errors with the correct line number information. --- diff --git a/source/loader.cpp b/source/loader.cpp index 1250d0f..4a86506 100644 --- a/source/loader.cpp +++ b/source/loader.cpp @@ -176,13 +176,6 @@ const string &Loader::get_source() const return cur_st->source; } -void Loader::error(const string &msg) const -{ - if(!cur_st) - throw logic_error("!cur_st"); - throw data_error(cur_st->source, cur_st->line, msg); -} - Loader::ActionKey::ActionKey(const string &k, const string &s): keyword(k), diff --git a/source/loader.h b/source/loader.h index 4a1faa3..6048861 100644 --- a/source/loader.h +++ b/source/loader.h @@ -139,9 +139,6 @@ protected: source may not necessarily be a file. */ const std::string &get_source() const; - /** Throws a data_error from the current line. */ - void error(const std::string &) const; - virtual void finish() { } };