Check error after called boost::filesystem::copy()
and rethrow if found an error. This is to get around boost 1.67 issue https://svn.boost.org/trac10/ticket/13585
This commit is contained in:
parent
1eca4959e7
commit
ce7cb0dd06
1 changed files with 5 additions and 0 deletions
|
|
@ -243,6 +243,11 @@ namespace fc {
|
|||
try {
|
||||
boost::system::error_code ec;
|
||||
boost::filesystem::copy( boost::filesystem::path(f), boost::filesystem::path(t), ec );
|
||||
if( ec )
|
||||
{
|
||||
FC_THROW( "Copy from ${srcfile} to ${dstfile} failed because ${reason}:${value}",
|
||||
("srcfile",f)("dstfile",t)("reason",ec.category().name())("value",ec.value()) );
|
||||
}
|
||||
} catch ( boost::system::system_error& e ) {
|
||||
FC_THROW( "Copy from ${srcfile} to ${dstfile} failed because ${reason}",
|
||||
("srcfile",f)("dstfile",t)("reason",e.what() ) );
|
||||
|
|
|
|||
Loading…
Reference in a new issue