@live-change/framework 0.9.193 → 0.9.195

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/lib/App.js CHANGED
@@ -1,4 +1,4 @@
1
- import {randomString, uidGenerator} from '@live-change/uid'
1
+ import { randomString, uidGenerator } from '@live-change/uid'
2
2
 
3
3
  import ReactiveDao from "@live-change/dao"
4
4
 
@@ -777,6 +777,11 @@ class App {
777
777
  await this.dao.request(['database', 'put'], this.databaseName, 'cache', cacheEntry)
778
778
  }
779
779
 
780
+ logicError(code, details) {
781
+ console.trace('logicError', code, details)
782
+ return code
783
+ }
784
+
780
785
  }
781
786
 
782
787
  export default App
@@ -10,7 +10,7 @@ export default function(module, app) {
10
10
  action.execute = async (...args) => {
11
11
  if(!(await access(...args))) {
12
12
  console.error("NOT AUTHORIZED ACTION", module.name, actionName)
13
- throw "notAuthorized"
13
+ throw app.logicError("notAuthorized")
14
14
  }
15
15
  return oldExec.apply(action, args)
16
16
  }
@@ -25,7 +25,7 @@ export default function(module, app) {
25
25
  view.observable = async (...args) => {
26
26
  if(!(await access(...args))) {
27
27
  console.error("NOT AUTHORIZED VIEW", module.name, viewName)
28
- throw "notAuthorized"
28
+ throw app.logicError("notAuthorized")
29
29
  }
30
30
  return oldObservable.apply(view, args)
31
31
  }
@@ -33,7 +33,7 @@ export default function(module, app) {
33
33
  view.get = async (...args) => {
34
34
  if(!(await access(...args))) {
35
35
  console.error("NOT AUTHORIZED VIEW", module.name, viewName)
36
- throw "notAuthorized"
36
+ throw app.logicError("notAuthorized")
37
37
  }
38
38
  return oldGet.apply(view, args)
39
39
  }
package/lib/utils.js CHANGED
@@ -423,4 +423,4 @@ export function expandObjectAttributes(object, prefix = '', acc = {}) {
423
423
  expandObjectAttributes(value, prefix + '_' + key, acc)
424
424
  }
425
425
  return acc
426
- }
426
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/framework",
3
- "version": "0.9.193",
3
+ "version": "0.9.195",
4
4
  "description": "Live Change Framework - ultimate solution for real time mobile/web apps",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -22,11 +22,11 @@
22
22
  },
23
23
  "homepage": "https://github.com/live-change/live-change-stack",
24
24
  "devDependencies": {
25
- "@live-change/dao": "^0.9.193",
26
- "@live-change/uid": "^0.9.193",
25
+ "@live-change/dao": "^0.9.195",
26
+ "@live-change/uid": "^0.9.195",
27
27
  "typedoc": "0.28.3",
28
28
  "typedoc-plugin-markdown": "^4.6.3",
29
29
  "typedoc-plugin-rename-defaults": "^0.7.3"
30
30
  },
31
- "gitHead": "8a7627bed2cb66684e7169ddb3998191612e57a9"
31
+ "gitHead": "9f61eddae56ddd89aba20988b8e208d948728496"
32
32
  }