comments & error handling
This commit is contained in:
parent
be4f21a681
commit
23c75290c7
@ -41,6 +41,9 @@ class StorageManager {
|
|||||||
// Transaction ID concept
|
// Transaction ID concept
|
||||||
//`${shard.id}-${new Date().getTime().toString(36)}`
|
//`${shard.id}-${new Date().getTime().toString(36)}`
|
||||||
|
|
||||||
|
//NULL RESPONSE IF COLLECTION DOES NOT EXIST!!
|
||||||
|
//EMPTY OBJECT IF NOTHING MATCHED!!
|
||||||
|
|
||||||
/** Message structure
|
/** Message structure
|
||||||
* {
|
* {
|
||||||
* provider: string, -- mongodb or mariadb
|
* provider: string, -- mongodb or mariadb
|
||||||
@ -60,7 +63,7 @@ class StorageManager {
|
|||||||
|
|
||||||
const response = await this.providers.get(message.provider)._query(message.request);
|
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);
|
this.manager.logger.write('error', `Provider ${message.provider} errored: ${response.message}`, shard);
|
||||||
return this._send(shard, response.error);
|
return this._send(shard, response.error);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user