BIND 10 trac2375, updated. 3bc74ec58bc9ff71ba579ef88082457f237afb30 [2376] Don't propagate exceptions from internal namespace
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Nov 19 15:34:44 UTC 2012
The branch, trac2375 has been updated
via 3bc74ec58bc9ff71ba579ef88082457f237afb30 (commit)
from ef8559b5d0b9c87852f1bc451c80b7aed97f66df (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 3bc74ec58bc9ff71ba579ef88082457f237afb30
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Mon Nov 19 16:33:28 2012 +0100
[2376] Don't propagate exceptions from internal namespace
Move the ReadError exception into the MasterLexer. That way, it is in
public namespace, so people can expect to see it.
-----------------------------------------------------------------------
Summary of changes:
src/lib/dns/master_lexer.h | 13 ++++++++++---
src/lib/dns/master_lexer_inputsource.cc | 3 ++-
src/lib/dns/master_lexer_inputsource.h | 12 ++----------
src/lib/dns/master_lexer_state.h | 4 ++--
4 files changed, 16 insertions(+), 16 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/dns/master_lexer.h b/src/lib/dns/master_lexer.h
index dee6197..384cf74 100644
--- a/src/lib/dns/master_lexer.h
+++ b/src/lib/dns/master_lexer.h
@@ -69,6 +69,14 @@ class State;
class MasterLexer {
friend class master_lexer_internal::State;
public:
+ /// \brief Exception thrown when we fail to read from the input
+ /// stream or file.
+ struct ReadError : public Unexpected {
+ ReadError(const char* file, size_t line, const char* what) :
+ Unexpected(file, line, what)
+ {}
+ };
+
class Token; // we define it separately for better readability
/// \brief Options for getNextToken.
@@ -198,9 +206,8 @@ public:
/// \throw isc::InvalidOperation in case the source is not available. This
/// may mean the pushSource() has not been called yet, or that the
/// current source has been read past the end.
- /// \throw isc::master_lexer_internal::InputSource::ReadError in case
- /// there's problem reading from the underlying source (eg. I/O error
- /// in the file on the disk).
+ /// \throw ReadError in case there's problem reading from the underlying
+ /// source (eg. I/O error in the file on the disk).
/// \throw std::bad_alloc in case allocation of some internal resources
/// or the token fail.
Token getNextToken(Options options = NONE);
diff --git a/src/lib/dns/master_lexer_inputsource.cc b/src/lib/dns/master_lexer_inputsource.cc
index effe163..03801f6 100644
--- a/src/lib/dns/master_lexer_inputsource.cc
+++ b/src/lib/dns/master_lexer_inputsource.cc
@@ -13,6 +13,7 @@
// PERFORMANCE OF THIS SOFTWARE.
#include <dns/master_lexer_inputsource.h>
+#include <dns/master_lexer.h>
#include <cerrno>
#include <cstring>
@@ -94,7 +95,7 @@ InputSource::getChar() {
// This has to come after the .eof() check as some
// implementations seem to check the eofbit also in .fail().
if (input_.fail()) {
- isc_throw(ReadError,
+ isc_throw(MasterLexer::ReadError,
"Error reading from the input stream: " << getName());
}
buffer_.push_back(c);
diff --git a/src/lib/dns/master_lexer_inputsource.h b/src/lib/dns/master_lexer_inputsource.h
index 8feffa2..1a4497f 100644
--- a/src/lib/dns/master_lexer_inputsource.h
+++ b/src/lib/dns/master_lexer_inputsource.h
@@ -56,14 +56,6 @@ public:
{}
};
- /// \brief Exception thrown when we fail to read from the input
- /// stream or file.
- struct ReadError : public Unexpected {
- ReadError(const char* file, size_t line, const char* what) :
- Unexpected(file, line, what)
- {}
- };
-
/// \brief Exception thrown when we fail to open the input file.
struct OpenError : public Unexpected {
OpenError(const char* file, size_t line, const char* what) :
@@ -124,8 +116,8 @@ public:
/// \brief Returns a single character from the input source. If end
/// of file is reached, \c END_OF_STREAM is returned.
///
- /// \throws ReadError when reading from the input stream or file
- /// fails.
+ /// \throws MasterLexer::ReadError when reading from the input stream or
+ /// file fails.
int getChar();
/// \brief Skips backward a single character in the input
diff --git a/src/lib/dns/master_lexer_state.h b/src/lib/dns/master_lexer_state.h
index 6f6ee9c..0c63b8f 100644
--- a/src/lib/dns/master_lexer_state.h
+++ b/src/lib/dns/master_lexer_state.h
@@ -69,7 +69,7 @@ public:
/// tokenization session. The lexer passes a reference to itself
/// and options given in \c getNextToken().
///
- /// \throw InputSource::ReadError Unexpected I/O error
+ /// \throw MasterLexer::ReadError Unexpected I/O error
/// \throw std::bad_alloc Internal resource allocation failure
///
/// \param lexer The lexer object that holds the main context.
@@ -85,7 +85,7 @@ public:
/// start(), and keep called on the returned object until NULL is
/// returned. The call chain will form the complete state transition.
///
- /// \throw InputSource::ReadError Unexpected I/O error
+ /// \throw MasterLexer::ReadError Unexpected I/O error
/// \throw std::bad_alloc Internal resource allocation failure
///
/// \param lexer The lexer object that holds the main context.
More information about the bind10-changes
mailing list