summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorAndreas Baumann <abaumann@yahoo.com>2012-08-12 19:13:52 +0200
committerAndreas Baumann <abaumann@yahoo.com>2012-08-12 19:13:52 +0200
commit5fe4ec20a6aa83dc8728ff83766efc35c7818ab6 (patch)
treed81a1be98664433080e69521982d6d3092d1a9f9 /src/modules
parent63929b266e3000374c5e5161e4495d64142b907e (diff)
downloadcrawler-5fe4ec20a6aa83dc8728ff83766efc35c7818ab6.tar.gz
crawler-5fe4ec20a6aa83dc8728ff83766efc35c7818ab6.tar.bz2
added a fetcher module test
Diffstat (limited to 'src/modules')
-rwxr-xr-xsrc/modules/fetcher/winhttp/WinHttpFetcher.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/modules/fetcher/winhttp/WinHttpFetcher.cpp b/src/modules/fetcher/winhttp/WinHttpFetcher.cpp
index a22ab1a..1adc7a0 100755
--- a/src/modules/fetcher/winhttp/WinHttpFetcher.cpp
+++ b/src/modules/fetcher/winhttp/WinHttpFetcher.cpp
@@ -1,6 +1,11 @@
#include "WinHttpFetcher.hpp"
#include "WinHttpRewindInputStream.hpp"
+#include "win32/errormsg.hpp"
+
+#include <sstream>
+#include <stdexcept>
+
WinHttpFetcher::WinHttpFetcher( )
: m_session( 0 )
{
@@ -8,6 +13,12 @@ WinHttpFetcher::WinHttpFetcher( )
WINHTTP_ACCESS_TYPE_DEFAULT_PROXY,
WINHTTP_NO_PROXY_NAME,
WINHTTP_NO_PROXY_BYPASS, 0 );
+
+ if( !m_session ) {
+ std::ostringstream ss;
+ ss << "Error creating WinHttp session: " << getLastError( );
+ throw new std::runtime_error( ss.str( ) );
+ }
}
WinHttpFetcher::~WinHttpFetcher( )