@trojs/openapi-server 1.2.0 → 1.2.2

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@trojs/openapi-server",
3
3
  "description": "OpenAPI Server",
4
- "version": "1.2.0",
4
+ "version": "1.2.2",
5
5
  "author": {
6
6
  "name": "Pieter Wigboldus",
7
7
  "url": "https://trojs.org/"
@@ -63,7 +63,11 @@ export const makeExpressCallback = ({
63
63
  } catch (error) {
64
64
  const errorCodeStatus = getStatusByError(error)
65
65
 
66
- logger.error(error)
66
+ if (errorCodeStatus >= 500) {
67
+ logger.error(error)
68
+ } else {
69
+ logger.warn(error)
70
+ }
67
71
 
68
72
  response.status(errorCodeStatus)
69
73
 
package/src/server.js CHANGED
@@ -29,16 +29,23 @@ const getOriginResourcePolicy = (origin) => ({
29
29
  * @typedef {import('./api.js').ApiSchema} ApiSchema
30
30
  * @typedef {import('./api.js').Logger} Logger
31
31
  * @typedef {import('express').Express} Express
32
+ */
33
+
34
+ /**
35
+ * @template {object} [T=object]
32
36
  * @typedef {object} Controller
33
37
  * @property {Context=} context
34
38
  * @property {Request=} request
35
39
  * @property {Response=} response
36
40
  * @property {object=} parameters
37
41
  * @property {object=} specification
38
- * @property {object=} post
42
+ * @property {T=} post
39
43
  * @property {string=} url
40
44
  * @property {Logger=} logger
41
45
  * @property {object=} meta
46
+ */
47
+
48
+ /**
42
49
  * @typedef {object} SentryConfig
43
50
  * @property {string=} dsn
44
51
  * @property {number=} tracesSampleRate