Skip to content

Commit

Permalink
Merge pull request #1740 from skalenetwork/bug/1433-unlock-shared-spa…
Browse files Browse the repository at this point in the history
…ce-if-unsuccessful-download

Bug/1433 cleanup shared space if unsuccessful download
  • Loading branch information
olehnikolaiev authored Dec 5, 2023
2 parents 1419be9 + bcc75a5 commit 1c975d5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions skaled/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,9 @@ void downloadSnapshot( unsigned block_number, std::shared_ptr< SnapshotManager >
throw std::runtime_error( strErrorDescription );
}
} catch ( ... ) {
std::throw_with_nested(
std::runtime_error( cc::error( "Exception while downloading snapshot" ) ) );
// remove partially downloaded snapshot
boost::filesystem::remove( saveTo );
std::throw_with_nested( std::runtime_error( "Exception while downloading snapshot" ) );
}
clog( VerbosityInfo, "downloadSnapshot" )
<< cc::success( "Snapshot download success for block " )
Expand Down

0 comments on commit 1c975d5

Please sign in to comment.