dbm-graph-api 1.1.5 → 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dbm-graph-api",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -130,6 +130,9 @@ export default class UrlRequest extends Dbm.core.BaseObject {
130
130
  if(dataFunctionItem) {
131
131
  returnData = await dataFunctionItem.controller.getData(aData, encodeSession);
132
132
  }
133
+ else {
134
+ this._logs.push("No function named " + aFunctionName);
135
+ }
133
136
 
134
137
  this._responseData = returnData;
135
138
  }
@@ -138,11 +138,18 @@ export default class WebSocketConnection extends Dbm.core.BaseObject {
138
138
  let dataFunctionItem = Dbm.getInstance().repository.getItemIfExists("graphApi/action/" + data['functionName']);
139
139
 
140
140
  let returnData = null;
141
- if(dataFunctionItem) {
142
- returnData = await dataFunctionItem.controller.performAction(data['data'], encodeSession);
141
+ let logs = [];
142
+
143
+ try {
144
+ if(dataFunctionItem) {
145
+ returnData = await dataFunctionItem.controller.performAction(data['data'], encodeSession);
146
+ }
147
+ }
148
+ catch(theError) {
149
+ logs.push(theError.message);
143
150
  }
144
151
 
145
- this._webSocket.send(JSON.stringify({"type": "data/response", "data": returnData, "requestId": data["requestId"]}));
152
+ this._webSocket.send(JSON.stringify({"type": "data/response", "data": returnData, "requestId": data["requestId"], "logs": logs}));
146
153
  }
147
154
  break;
148
155
  case "item":