mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-03-05 17:44:52 +01:00
Catch exceptions for single regions
This commit is contained in:
parent
a3d6648fa6
commit
75671b4b96
1 changed files with 14 additions and 8 deletions
|
@ -117,6 +117,7 @@ static void doRegion(const std::string &input, const std::string &output) {
|
|||
|
||||
const std::string tmpfile = output + ".tmp";
|
||||
|
||||
try {
|
||||
uint32_t image[DIM][DIM] = {};
|
||||
World::Region::visitChunks(input.c_str(), [&image] (size_t X, size_t Z, const World::Chunk *chunk) { addChunk(image, X, Z, chunk); });
|
||||
|
||||
|
@ -131,6 +132,11 @@ static void doRegion(const std::string &input, const std::string &output) {
|
|||
unlink(tmpfile.c_str());
|
||||
}
|
||||
}
|
||||
catch (const std::exception& ex) {
|
||||
std::fprintf(stderr, "Failed to generate %s: %s\n", output.c_str(), ex.what());
|
||||
unlink(tmpfile.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
if (argc < 3) {
|
||||
|
|
Loading…
Add table
Reference in a new issue