summaryrefslogtreecommitdiff
path: root/tests/fetcher
diff options
context:
space:
mode:
Diffstat (limited to 'tests/fetcher')
-rwxr-xr-xtests/fetcher/test1.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/fetcher/test1.cpp b/tests/fetcher/test1.cpp
index 9e5502d..0355500 100755
--- a/tests/fetcher/test1.cpp
+++ b/tests/fetcher/test1.cpp
@@ -70,6 +70,17 @@ int main( int argc, char *argv[] )
URL url = normalizer.parseUrl( urlString );
RewindInputStream *s = fetcher->fetch( url );
+ if( !s->good( ) ) {
+ cerr << "Failed to fetch '" << url << "': " << s->lastErrMsg( ) << endl;
+ delete s;
+#ifdef USE_MODULELOADER
+ fetchers.destroy( fetcher );
+#else
+ delete fetcher;
+#endif
+ return 1;
+ }
+
copy_stream( *s, cout );
// s->rewind( );
// copy_stream( *s, cout );