Another snark refactoring bug, log tweaks

This commit is contained in:
zzz
2013-10-08 01:17:36 +00:00
parent 38cef14cf4
commit 8872437caf
3 changed files with 4 additions and 4 deletions

View File

@ -999,13 +999,13 @@ class PeerCoordinator implements PeerListener
}
catch (IOException ioe)
{
snark.stopTorrent();
String msg = "Error writing storage (piece " + piece + ") for " + metainfo.getName() + ": " + ioe;
_log.error(msg, ioe);
if (listener != null) {
listener.addMessage(msg);
listener.addMessage("Fatal storage error: Stopping torrent " + metainfo.getName());
}
snark.stopTorrent();
throw new RuntimeException(msg, ioe);
}
wantedPieces.remove(p);

View File

@ -902,7 +902,7 @@ public class SnarkManager implements CompleteListener {
filename = sfile.getCanonicalPath();
} catch (IOException ioe) {
_log.error("Unable to add the torrent " + filename, ioe);
addMessage(_("Error: Could not add the torrent {0}", filename) + ": " + ioe.getMessage());
addMessage(_("Error: Could not add the torrent {0}", filename) + ": " + ioe);
return;
}
File dataDir = getDataDir();
@ -1677,7 +1677,7 @@ public class SnarkManager implements CompleteListener {
// don't let one bad torrent kill the whole loop
addTorrent(name, !shouldAutoStart());
} catch (Exception e) {
addMessage(_("Error: Could not add the torrent {0}", name) + ": " + e.getMessage());
addMessage(_("Error: Could not add the torrent {0}", name) + ": " + e);
_log.error("Unable to add the torrent " + name, e);
}
}

View File

@ -825,7 +825,7 @@ public class Storage
}
if (++file >= _torrentFiles.size())
break;
fileEnd += tf.length;
fileEnd += _torrentFiles.get(file).length;
}
if (correctHash)
{