@webtypen/webframez-core 0.0.46 → 0.0.47
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/Router/Router.d.ts
CHANGED
package/lib/Router/Router.js
CHANGED
|
@@ -398,7 +398,7 @@ class RouterFacade {
|
|
|
398
398
|
if (this.mode === "aws-lambda") {
|
|
399
399
|
return {
|
|
400
400
|
statusCode: response.statusCode,
|
|
401
|
-
body: JSON.stringify(response.content),
|
|
401
|
+
body: typeof response.content === "object" ? JSON.stringify(response.content) : response.content,
|
|
402
402
|
headers: response.headers,
|
|
403
403
|
};
|
|
404
404
|
}
|
|
@@ -414,6 +414,7 @@ class RouterFacade {
|
|
|
414
414
|
body: JSON.stringify({
|
|
415
415
|
status: "error",
|
|
416
416
|
message: "Error running the component ...",
|
|
417
|
+
error: e.toString(),
|
|
417
418
|
}),
|
|
418
419
|
headers: response.headers,
|
|
419
420
|
};
|
package/package.json
CHANGED
package/src/Router/Router.ts
CHANGED
|
@@ -472,20 +472,21 @@ class RouterFacade {
|
|
|
472
472
|
if (this.mode === "aws-lambda") {
|
|
473
473
|
return {
|
|
474
474
|
statusCode: response.statusCode,
|
|
475
|
-
body: JSON.stringify(response.content),
|
|
475
|
+
body: typeof response.content === "object" ? JSON.stringify(response.content) : response.content,
|
|
476
476
|
headers: response.headers,
|
|
477
477
|
};
|
|
478
478
|
} else if (res && req) {
|
|
479
479
|
res.end();
|
|
480
480
|
this.requestConsoleLog(req, response.statusCode);
|
|
481
481
|
}
|
|
482
|
-
} catch (e) {
|
|
482
|
+
} catch (e: any) {
|
|
483
483
|
if (this.mode === "aws-lambda") {
|
|
484
484
|
return {
|
|
485
485
|
statusCode: 500,
|
|
486
486
|
body: JSON.stringify({
|
|
487
487
|
status: "error",
|
|
488
488
|
message: "Error running the component ...",
|
|
489
|
+
error: e.toString(),
|
|
489
490
|
}),
|
|
490
491
|
headers: response.headers,
|
|
491
492
|
};
|