Skip to content

Commit

Permalink
Handle exceptions correctly in Realm2JSON tool
Browse files Browse the repository at this point in the history
  • Loading branch information
jedelbo committed Apr 3, 2024
1 parent 8f54801 commit 6005e69
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* Update libuv used in object store tests from v1.35.0 to v1.48.0 ([PR #7508](https://github.com/realm/realm-core/pull/7508)).
* Made `set_default_logger` nullable in the bindgen spec.yml (PR [#7515](https://github.com/realm/realm-core/pull/7515)).
* Added `App::default_base_url()` static accessor for SDKs to retrieve the default base URL from Core. ([PR #7534](https://github.com/realm/realm-core/pull/7534))
* Realm2JSON tool will now correctly upgrade file to current fileformat.

----------------------------------------------

Expand Down
12 changes: 6 additions & 6 deletions src/realm/exec/realm2json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,17 @@ int main(int argc, char const* argv[])
print(db->start_read());
return 0;
}
catch (const realm::FileFormatUpgradeRequired&) {
options.allow_file_format_upgrade = true;
options.is_immutable = false;
}
catch (const realm::IncompatibleHistories&) {
hist = realm::sync::make_client_replication();
options.allow_file_format_upgrade = false;
options.is_immutable = true;
}
catch (...) {
break;
catch (const realm::FileAccessError& e) {
if (e.code() != realm::ErrorCodes::FileFormatUpgradeRequired) {
throw;
}
options.allow_file_format_upgrade = true;
options.is_immutable = false;
}
}

Expand Down

0 comments on commit 6005e69

Please sign in to comment.