@bbn/bbn 2.0.250 → 2.0.252

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.
@@ -18,13 +18,15 @@ export default class bbnDbCenter {
18
18
  }
19
19
  const database = command.database;
20
20
  this.queues[database] = (this.queues[database] || Promise.resolve())
21
- .catch(() => undefined)
21
+ .catch((e) => console.log(e))
22
22
  .then(async () => {
23
23
  try {
24
24
  const result = await this.execute(command);
25
25
  this.postSuccess(port, command.id, result);
26
26
  }
27
27
  catch (error) {
28
+ throw error;
29
+ console.log(error || "NO ERROR?!");
28
30
  this.postError(port, command.id, this.serializeError(error) + ` - DATA: ${JSON.stringify(command)}`);
29
31
  }
30
32
  });
@@ -94,7 +94,9 @@ class DbObject {
94
94
  req.onsuccess = () => {
95
95
  inserted++;
96
96
  };
97
- req.onerror = () => {
97
+ req.onerror = (e) => {
98
+ log("INSERT ERROR!");
99
+ log(e);
98
100
  this.lastErr = req.error;
99
101
  log(req.error);
100
102
  };
@@ -1,7 +1,13 @@
1
1
  export default function transactionDone(tx) {
2
2
  return new Promise((resolve, reject) => {
3
3
  tx.oncomplete = () => resolve();
4
- tx.onabort = () => reject(tx.error);
5
- tx.onerror = () => reject(tx.error);
4
+ tx.onabort = () => {
5
+ console.log(tx.error);
6
+ reject(tx.error);
7
+ };
8
+ tx.onerror = () => {
9
+ console.log(tx.error);
10
+ reject(tx.error);
11
+ };
6
12
  });
7
13
  }
@@ -4,7 +4,7 @@
4
4
  * @global
5
5
  * @memberof bbn.fn
6
6
  * @param {String|Date} d
7
- * @param {String} wrong_result
7
+ * @param {String|Boolean} wrong_result
8
8
  * @returns
9
9
  */
10
- export default function fdate(d: any, wrong_result?: boolean): any;
10
+ export default function fdate(d: any, wrong_result?: boolean): string;
@@ -6,18 +6,24 @@ import isString from '../type/isString.js';
6
6
  * @global
7
7
  * @memberof bbn.fn
8
8
  * @param {String|Date} d
9
- * @param {String} wrong_result
9
+ * @param {String|Boolean} wrong_result
10
10
  * @returns
11
11
  */
12
12
  export default function fdate(d, wrong_result = false) {
13
- let r = dt(d);
13
+ let r;
14
+ try {
15
+ r = dt(d);
16
+ }
17
+ catch (e) {
18
+ r = { isValid: false };
19
+ }
14
20
  let time = false;
15
21
  // Retro compatibility
16
22
  if (wrong_result === true) {
17
23
  time = true;
18
24
  }
19
25
  if (!r.isValid) {
20
- return wrong_result && isString(wrong_result) ? wrong_result : '';
26
+ return (wrong_result && isString(wrong_result) ? wrong_result : '');
21
27
  }
22
28
  return r.fdate(false, time);
23
29
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbn/bbn",
3
- "version": "2.0.250",
3
+ "version": "2.0.252",
4
4
  "description": "Javascript toolkit",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",