-
Type: Bug
-
Resolution: Cannot Reproduce
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
How frequently does the bug occur?
All the time
Description
Exceptions are not being caught!!!
let realm;
let response;
try {
realm = options.realm || await Realm.open(db);
realm.beginTransaction();
response = await getCustomer({ id: payload.id }, { realm: realm }) if (response) { response.date_updated = Date.now(); if (payload.name) { response.name = payload?.name; } if (payload.email) { response.email = payload?.email; } if (Array.isArray(payload.tags)) { response.tags = payload.tags; } if (payload.address) { response.address = realm.create(AddressModel, payload.address); } if (payload.remarks) { response.remarks = payload.remarks; } } realm.commitTransaction();
if (!options.realm) { response = response?.toJSON(); } } catch (error) { console.log(error) console.log("Hey") if (realm?.isInTransaction === true) { realm?.cancelTransaction(); } } finally { if (!options.realm) { realm?.close(); } }
Stacktrace & log output
No response
Can you reproduce the bug?
Yes, always
Reproduction Steps
No response
Version
10.19.5
What SDK flavour are you using?
Local Database only
Are you using encryption?
No, not using encryption
Platform OS and version(s)
Node 14.x.x
Build environment
No response
Cocoapods version
No response