@paroicms/server 1.9.0 → 1.10.0
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 +1 -1
- package/dist/modules/app.module.js +1 -1
- package/dist/modules/app.module.js.map +1 -1
- package/dist/modules/public-site/app-exception-filter.d.ts +3 -3
- package/dist/modules/public-site/app-exception-filter.js +30 -20
- package/dist/modules/public-site/app-exception-filter.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -33,7 +33,7 @@ Here are some tips:
|
|
|
33
33
|
|
|
34
34
|
## Documentation
|
|
35
35
|
|
|
36
|
-
The documentation on how to configure ParoiCMS is [here](https://gitlab.com/paroi/opensource/paroicms/-/blob/main/documentation/index.md).
|
|
36
|
+
The documentation on how to configure ParoiCMS is [here](https://gitlab.com/paroi/opensource/paroicms/-/blob/main/documentation/configuration/index.md).
|
|
37
37
|
|
|
38
38
|
## Contribute
|
|
39
39
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.module.js","sourceRoot":"","sources":["../../src/modules/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,uCAAqD;AACrD,iDAAoD;AACpD,qDAAiD;AACjD,6DAAwD;AACxD,sEAAiE;AACjE,
|
|
1
|
+
{"version":3,"file":"app.module.js","sourceRoot":"","sources":["../../src/modules/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,uCAAqD;AACrD,iDAAoD;AACpD,qDAAiD;AACjD,6DAAwD;AACxD,sEAAiE;AACjE,6EAAyE;AACzE,yEAAoE;AACpE,wEAAmE;AA0B5D,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,8BAAS;oBAAT,SAAS;IAxBrB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,2BAAe,CAAC,OAAO,CAAC;gBACtB;oBACE,KAAK,EAAE,EAAE;oBACT,GAAG,EAAE,IAAI;iBACV;aACF,CAAC;YACF,qCAAgB;YAChB,qCAAgB;YAChB,mCAAe;SAChB;QACD,WAAW,EAAE,CAAC,8BAAa,CAAC;QAC5B,SAAS,EAAE;YACT;gBACE,OAAO,EAAE,iBAAU;gBACnB,QAAQ,EAAE,0CAAmB;aAC9B;YACD;gBACE,OAAO,EAAE,gBAAS;gBAClB,QAAQ,EAAE,uCAAiB;aAC5B;SACF;KACF,CAAC;GACW,SAAS,CAAG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare class
|
|
3
|
-
catch(
|
|
1
|
+
import { type ArgumentsHost } from "@nestjs/common";
|
|
2
|
+
export declare class AllExceptionsFilter {
|
|
3
|
+
catch(exception: unknown, host: ArgumentsHost): Promise<void>;
|
|
4
4
|
}
|
|
@@ -6,36 +6,46 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.
|
|
9
|
+
exports.AllExceptionsFilter = void 0;
|
|
10
10
|
const common_1 = require("@nestjs/common");
|
|
11
11
|
const serve_html_or_1 = require("../../common/serve-html-or");
|
|
12
12
|
const context_1 = require("../../context");
|
|
13
13
|
const http_helpers_1 = require("../../express/http-helpers");
|
|
14
14
|
const site_context_1 = require("../../site-context/site-context");
|
|
15
|
-
let
|
|
16
|
-
async catch(
|
|
15
|
+
let AllExceptionsFilter = class AllExceptionsFilter {
|
|
16
|
+
async catch(exception, host) {
|
|
17
17
|
if (host.getType() !== "http")
|
|
18
|
-
throw
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
throw exception;
|
|
19
|
+
const ctx = host.switchToHttp();
|
|
20
|
+
const req = ctx.getRequest();
|
|
21
|
+
const res = ctx.getResponse();
|
|
22
|
+
const siteContext = (0, site_context_1.getActiveSiteContext)(req.hostname, { returnsUndef: true });
|
|
23
|
+
if (exception instanceof common_1.NotFoundException) {
|
|
24
|
+
try {
|
|
25
|
+
if (siteContext) {
|
|
26
|
+
await (0, serve_html_or_1.render404Html)(siteContext, res);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
(0, http_helpers_1.serve404SimpleHtml)(res);
|
|
30
|
+
}
|
|
26
31
|
}
|
|
27
|
-
|
|
28
|
-
(
|
|
32
|
+
catch (error) {
|
|
33
|
+
context_1.platformLog.error("error when rendering a 404", error);
|
|
34
|
+
(0, http_helpers_1.serve500Html)(res);
|
|
29
35
|
}
|
|
36
|
+
return;
|
|
30
37
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
(0, http_helpers_1.serve500Html)(res);
|
|
38
|
+
if (siteContext) {
|
|
39
|
+
siteContext.siteLog.error(exception);
|
|
34
40
|
}
|
|
41
|
+
else {
|
|
42
|
+
context_1.platformLog.error(exception);
|
|
43
|
+
}
|
|
44
|
+
(0, http_helpers_1.serve500Html)(res);
|
|
35
45
|
}
|
|
36
46
|
};
|
|
37
|
-
exports.
|
|
38
|
-
exports.
|
|
39
|
-
(0, common_1.Catch)(
|
|
40
|
-
],
|
|
47
|
+
exports.AllExceptionsFilter = AllExceptionsFilter;
|
|
48
|
+
exports.AllExceptionsFilter = AllExceptionsFilter = __decorate([
|
|
49
|
+
(0, common_1.Catch)()
|
|
50
|
+
], AllExceptionsFilter);
|
|
41
51
|
//# sourceMappingURL=app-exception-filter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-exception-filter.js","sourceRoot":"","sources":["../../../src/modules/public-site/app-exception-filter.ts"],"names":[],"mappings":";;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"app-exception-filter.js","sourceRoot":"","sources":["../../../src/modules/public-site/app-exception-filter.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA8E;AAE9E,8DAA2D;AA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