From b7013f1be9a5f09ecae4b37f0986352abfcd0dc1 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 22 Feb 2009 07:20:56 +0000 Subject: replaced regular throws with AnytunError::thowErr --- src/encryptedPacket.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/encryptedPacket.cpp') diff --git a/src/encryptedPacket.cpp b/src/encryptedPacket.cpp index 9a1e063..34d2725 100644 --- a/src/encryptedPacket.cpp +++ b/src/encryptedPacket.cpp @@ -37,6 +37,7 @@ #include "endian.h" #include "datatypes.h" #include "log.h" +#include "anytunError.hpp" EncryptedPacket::EncryptedPacket(u_int32_t payload_length, bool allow_realloc) : Buffer(payload_length + sizeof(struct HeaderStruct), allow_realloc) @@ -137,14 +138,14 @@ void EncryptedPacket::reinit() if(length_ < (sizeof(struct HeaderStruct))) { header_ = NULL; - throw std::runtime_error("encrypted packet can't be initialized, buffer is too small"); + AnytunError::throwErr() << "encrypted packet can't be initialized, buffer is too small"; } if(auth_tag_) { if(length_ < (sizeof(struct HeaderStruct) + AUTHTAG_SIZE)) { auth_tag_ = NULL; - throw std::runtime_error("auth-tag can't be enabled, buffer is too small"); + AnytunError::throwErr() << "auth-tag can't be enabled, buffer is too small"; } auth_tag_ = buf_ + length_ - AUTHTAG_SIZE; } @@ -179,7 +180,7 @@ void EncryptedPacket::withAuthTag(bool b) if(b) { if(length_ < (sizeof(struct HeaderStruct) + AUTHTAG_SIZE)) - throw std::runtime_error("auth-tag can't be enabled, buffer is too small"); + AnytunError::throwErr() << "auth-tag can't be enabled, buffer is too small"; auth_tag_ = buf_ + length_ - AUTHTAG_SIZE; } -- cgit v1.2.3