comments & error handling

This commit is contained in:
Erik 2020-04-19 22:53:02 +03:00
parent be4f21a681
commit 23c75290c7

View File

@ -41,6 +41,9 @@ class StorageManager {
// Transaction ID concept
//`${shard.id}-${new Date().getTime().toString(36)}`
//NULL RESPONSE IF COLLECTION DOES NOT EXIST!!
//EMPTY OBJECT IF NOTHING MATCHED!!
/** Message structure
* {
* provider: string, -- mongodb or mariadb
@ -60,7 +63,7 @@ class StorageManager {
const response = await this.providers.get(message.provider)._query(message.request);
if(response.error) {
if(response && response.error) {
this.manager.logger.write('error', `Provider ${message.provider} errored: ${response.message}`, shard);
return this._send(shard, response.error);
}