Browse Source

logging key and table in rethink instead due to undefined not serializing with objects (see previous commit)

tags/v0.3.2.18
Big Bad Waffle 4 years ago
parent
commit
d47ecb02a7
1 changed files with 9 additions and 9 deletions
  1. +9
    -9
      src/server/security/ioRethink.js

+ 9
- 9
src/server/security/ioRethink.js View File

@@ -121,7 +121,7 @@ module.exports = {
})
.run(con);
} catch (e) {
this.logError(e, value);
this.logError(e, table, id);
}

con.close();
@@ -171,7 +171,7 @@ module.exports = {
})
.run(con);
} catch (e) {
this.logError(e, value);
this.logError(e, table, key);
}

con.close();
@@ -192,19 +192,19 @@ module.exports = {
return !!res;
},

logError: async function (error, value) {
logError: async function (error, table, key) {
try {
const stringValue = JSON.stringify(value);
const errorValue = `${error.toString()} | ${error.stack.toString()} | ${table} | ${key}`;

await this.setAsync({
key: new Date(),
table: 'error',
value: error.toString() + ' | ' + error.stack.toString() + ' | ' + stringValue
});

process.send({
event: 'onCrashed'
value: errorValue
});
} catch (e) {}

process.send({
event: 'onCrashed'
});
}
};

Loading…
Cancel
Save