@liberstudio/cloudflare-list 2.2.2 → 2.2.4
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.
|
@@ -19,11 +19,11 @@ let AllExceptionsFilter = AllExceptionsFilter_1 = class AllExceptionsFilter {
|
|
|
19
19
|
const request = ctx.getRequest();
|
|
20
20
|
const response = ctx.getResponse();
|
|
21
21
|
// ✅ SuperTokens gestisce i propri errori autonomamente
|
|
22
|
-
if (request.url.startsWith("/auth")) {
|
|
23
|
-
|
|
24
|
-
}
|
|
22
|
+
// if (request.url.startsWith("/auth")) {
|
|
23
|
+
// return;
|
|
24
|
+
// }
|
|
25
25
|
const status = exception instanceof common_1.HttpException ? exception.getStatus() : common_1.HttpStatus.INTERNAL_SERVER_ERROR;
|
|
26
|
-
const message = exception instanceof common_1.HttpException ? exception.getResponse() : "Internal server error";
|
|
26
|
+
const message = exception instanceof common_1.HttpException ? exception.getResponse() : exception instanceof Error ? exception.message : "Internal server error";
|
|
27
27
|
const ip = (0, get_client_ip_util_1.getClientIp)(request);
|
|
28
28
|
const errorLog = {
|
|
29
29
|
ip,
|
|
@@ -38,12 +38,12 @@ let AllExceptionsFilter = AllExceptionsFilter_1 = class AllExceptionsFilter {
|
|
|
38
38
|
stack: exception instanceof Error ? exception.stack : undefined,
|
|
39
39
|
};
|
|
40
40
|
/* const isMissingToken = message === "Invalid or missing token"; */
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
41
|
+
if (status >= 500) {
|
|
42
|
+
this.logger.error(`[${ip}] [${request.method}] ${request.url} → ${status}`, JSON.stringify(errorLog, null, 2));
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
this.logger.warn(`[${ip}] [${request.method}] ${request.url} → ${status}`, JSON.stringify(errorLog, null, 2));
|
|
46
|
+
}
|
|
47
47
|
response.status(status).json({
|
|
48
48
|
statusCode: status,
|
|
49
49
|
timestamp: errorLog.timestamp,
|