@pbvision/fastify-firestore-service 0.0.32 → 0.0.34

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": "@pbvision/fastify-firestore-service",
3
- "version": "0.0.32",
3
+ "version": "0.0.34",
4
4
  "description": "Web Framework using Fastify and Firestore ORM",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -42,7 +42,7 @@
42
42
  "@fastify/static": "^6.12",
43
43
  "@fastify/swagger": "^8.1.0",
44
44
  "@fastify/swagger-ui": "^2.0.1",
45
- "@pbvision/firestore-orm": "^0.0.14",
45
+ "@pbvision/firestore-orm": "^0.0.15",
46
46
  "@sentry/node": "^7.91.0",
47
47
  "fastify": "^4.10.0",
48
48
  "fastify-plugin": "^4.5.1",
@@ -2,7 +2,7 @@ import S from '@pbvision/schema'
2
2
  import * as Sentry from '@sentry/node'
3
3
  import fp from 'fastify-plugin'
4
4
 
5
- import { InvalidInputException } from '../api/exception.js'
5
+ import { InvalidInputException, __RequestDone } from '../api/exception.js'
6
6
 
7
7
  export default fp(function (fastify, options, next) {
8
8
  const isLocalhost = process.env.NODE_ENV === 'localhost'
@@ -112,11 +112,15 @@ export default fp(function (fastify, options, next) {
112
112
  url: req.url,
113
113
  status: errInfo.status
114
114
  })
115
- scope.setExtras({
115
+ const extras = {
116
116
  msg: errInfo.message,
117
117
  reqId: req.id,
118
118
  userAgent: req.headers['user-agent'] ?? 'not set'
119
- })
119
+ }
120
+ if (error instanceof __RequestDone) {
121
+ extras.data = error.data
122
+ }
123
+ scope.setExtras(extras)
120
124
  Sentry.captureException(error)
121
125
  })
122
126