@jcbuisson/express-x 1.0.2 → 1.0.3

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/expressX.js +3 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jcbuisson/express-x",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "",
5
5
  "main": "src/expressX.js",
6
6
  "repository": {
package/src/expressX.js CHANGED
@@ -67,6 +67,9 @@ function expressX(app) {
67
67
  service[methodName] = async (context, ...args) => {
68
68
  context.args = args
69
69
 
70
+ // if a hook or the method throws an error, it will be caught by `socket.on('client-request'`
71
+ // and the client will get a rejected promise
72
+
70
73
  // call 'before' hooks, modifying `context.args`
71
74
  const beforeMethodHooks = service?.hooks?.before && service.hooks.before[methodName] || []
72
75
  const beforeAllHooks = service?.hooks?.before?.all || []
@@ -224,7 +227,6 @@ function expressX(app) {
224
227
  }
225
228
  }
226
229
  } catch(error) {
227
- console.log('error', error)
228
230
  io.emit('client-response', {
229
231
  uid,
230
232
  error,