changeset 667:1c8898816fd0

* More useful error message
author Chris Cannam
date Thu, 03 Feb 2011 13:15:07 +0000
parents c3dee40e77d2
children ad7c96620886
files data/fileio/AudioFileReaderFactory.cpp
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/data/fileio/AudioFileReaderFactory.cpp	Mon Oct 25 21:14:40 2010 +0200
+++ b/data/fileio/AudioFileReaderFactory.cpp	Thu Feb 03 13:15:07 2011 +0000
@@ -75,8 +75,13 @@
 
 //    std::cerr << "AudioFileReaderFactory::createReader(\"" << source.getLocation().toStdString() << "\"): Requested rate: " << targetRate << std::endl;
 
-    if (!source.isOK() || !source.isAvailable()) {
-        std::cerr << "AudioFileReaderFactory::createReader(\"" << source.getLocation().toStdString() << "\": Source unavailable" << std::endl;
+    if (!source.isOK()) {
+        std::cerr << "AudioFileReaderFactory::createReader(\"" << source.getLocation().toStdString() << "\": Failed to retrieve source (transmission error?): " << source.getErrorString().toStdString() << std::endl;
+        return 0;
+    }
+
+    if (!source.isAvailable()) {
+        std::cerr << "AudioFileReaderFactory::createReader(\"" << source.getLocation().toStdString() << "\": Source not found" << std::endl;
         return 0;
     }