Revision: 1493
http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=1493&view=rev
Author: rorthomas
Date: 2010-07-22 23:56:25 +0000 (Thu, 22 Jul 2010)
Log Message:
-----------
improved installer log verbosity on opening files
Modified Paths:
--------------
trunk/source/installer/wsyncdownload.cpp
Modified: trunk/source/installer/wsyncdownload.cpp
===================================================================
--- trunk/source/installer/wsyncdownload.cpp 2010-07-22 21:22:01 UTC (rev
1492)
+++ trunk/source/installer/wsyncdownload.cpp 2010-07-22 23:56:25 UTC (rev
1493)
@@ -167,11 +167,24 @@
}
}
- // open local file late -> prevent creating emoty files
- myfile.open(localFile.string().c_str(), ios::out | ios::binary);
+ // open local file late -> prevent creating empty files
+ try
+ {
+ // throw exceptions
+ myfile.exceptions ( ofstream::eofbit |
ofstream::failbit | ofstream::badbit );
+ myfile.open(localFile.string().c_str(), ios::out |
ios::binary);
+ }
+ catch (ofstream::failure e)
+ {
+ LOG("DLFile-%04d|error opening local file: %s. error:
%s\n", jobID, localFile.string().c_str(), e.what());
+ LOG("DLFile-%04d|download URL: http://%s%s\n", jobID,
server.c_str(), path.c_str());
+ if(wxp) wxp->Update(1000, wxT("error"));
+ return 2;
+ }
+
if(!myfile.is_open())
{
- LOG("DLFile-%04d|error opening local file: %d\n",
jobID, localFile.string().c_str());
+ LOG("DLFile-%04d|error opening local file: %s\n",
jobID, localFile.string().c_str());
LOG("DLFile-%04d|download URL: http://%s%s\n", jobID,
server.c_str(), path.c_str());
if(wxp) wxp->Update(1000, wxT("error"));
return 2;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Rigsofrods-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rigsofrods-devel