better/more useful error reporting for cards with bad URLs in cards.txt when downloading LQ pics

This commit is contained in:
jendave
2011-08-06 06:12:35 +00:00
parent aa0fec9926
commit d10bffa4fc

View File

@@ -16,6 +16,7 @@ import java.io.FileReader;
import java.net.InetSocketAddress;
import java.net.Proxy;
import java.net.URL;
import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.StringTokenizer;
@@ -216,6 +217,7 @@ public class Gui_DownloadPictures_LQ extends DefaultBoundedRangeModel implements
File f = new File(base, cName);
try {
in = new BufferedInputStream(new URL(url).openConnection(p).getInputStream());
out = new BufferedOutputStream(new FileOutputStream(f));
@@ -238,6 +240,11 @@ public class Gui_DownloadPictures_LQ extends DefaultBoundedRangeModel implements
in.close();
out.flush();
out.close();
}
catch(MalformedURLException mURLe) {
System.out.println("bad URL for: "+cards[card].name);
//Log.error("LQ Pictures", "Malformed URL for: "+cards[card].name, mURLe);
}
} catch(Exception ex) {
Log.error("LQ Pictures", "Error downloading pictures", ex);
}