serverless-offline 14.3.0 → 14.3.1

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/README.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # Serverless Offline
2
2
 
3
+ <div align="center">
4
+ <p>
5
+ <sup>
6
+ <a href="https://github.com/sponsors/dherault">Serverless-offline is supported by the community.</a>
7
+ </sup>
8
+ </p>
9
+ <sup>
10
+ Special thanks to:
11
+ </sup>
12
+ <a href="https://arccode.dev?ref=so">
13
+ <div>
14
+ <img src="https://arccode.dev/images/logotype.png" height="64" alt="Arccode">
15
+ </div>
16
+ <b>
17
+ The first role-playing game for developers
18
+ </b>
19
+ <div>
20
+ XP, level ups and guilds. All while you work.
21
+ </div>
22
+ </a>
23
+ </div>
24
+ &nbsp;
3
25
  <p>
4
26
  <a href="https://www.serverless.com">
5
27
  <img src="http://public.serverless.com/badges/v3.svg">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "serverless-offline",
3
- "version": "14.3.0",
3
+ "version": "14.3.1",
4
4
  "description": "Emulate AWS λ and API Gateway locally when developing your Serverless project",
5
5
  "license": "MIT",
6
6
  "exports": {
@@ -429,6 +429,8 @@ export default class ServerlessOffline {
429
429
  const modules = this.#options.preLoadModules.split(",")
430
430
 
431
431
  modules.forEach((module) => {
432
+ if (!module) return
433
+
432
434
  try {
433
435
  import(module)
434
436
  } catch (error) {
@@ -645,7 +645,7 @@ export default class HttpServer {
645
645
  /* RESPONSE SELECTION (among endpoint's possible responses) */
646
646
 
647
647
  // Failure handling
648
- let errorStatusCode = "500"
648
+ let errorStatusCode = "502"
649
649
 
650
650
  if (err) {
651
651
  const errorMessage = (err.message || err).toString()
@@ -655,17 +655,14 @@ export default class HttpServer {
655
655
  if (found && found.length > 1) {
656
656
  ;[, errorStatusCode] = found
657
657
  } else {
658
- errorStatusCode = "500"
658
+ errorStatusCode = "502"
659
659
  }
660
660
 
661
661
  // Mocks Lambda errors
662
662
  result = {
663
- body: JSON.stringify({
664
- message: errorMessage,
665
- stackTrace: this.#getArrayStackTrace(err.stack),
666
- type: err.constructor.name,
667
- }),
668
- statusCode: errorStatusCode,
663
+ errorMessage,
664
+ errorType: err.constructor.name,
665
+ stackTrace: this.#getArrayStackTrace(err.stack),
669
666
  }
670
667
 
671
668
  log.error(errorMessage)
@@ -104,9 +104,9 @@ export default class PythonRunner {
104
104
  })
105
105
 
106
106
  const onErr = (data) => {
107
- log.notice(data.toString())
107
+ // TODO
108
108
 
109
- rej(new Error("Internal Server Error"))
109
+ log.notice(data.toString())
110
110
  }
111
111
 
112
112
  const onLine = (line) => {