Skip to content

Commit

Permalink
Minor try/catch fix
Browse files Browse the repository at this point in the history
  • Loading branch information
diegolmello committed Jul 1, 2021
1 parent fe71ea3 commit daf827b
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions app/lib/methods/getRoles.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,26 @@ export async function onRolesChanged(ddpMessage) {
const rolesCollection = db.get('roles');
try {
const rolesRecord = await rolesCollection.find(_id);
await db.action(async() => {
try {
try {
await db.action(async() => {
await rolesRecord.update((u) => {
u.description = description;
});
} catch (e) {
log(e);
}
});
});
} catch (e) {
log(e);
}
reduxStore.dispatch(updateRoles(_id, description));
} catch (err) {
await db.action(async() => {
try {
try {
await db.action(async() => {
await rolesCollection.create((post) => {
post._raw = sanitizedRaw({ id: _id, description }, rolesCollection.schema);
});
} catch (e) {
log(e);
}
});
});
} catch (e) {
log(e);
}
reduxStore.dispatch(updateRoles(_id, description || _id));
}
}
Expand Down

0 comments on commit daf827b

Please sign in to comment.