@arkyn/server 1.4.32 → 1.4.33
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globalErrorHandler.d.ts","sourceRoot":"","sources":["../../src/helpers/globalErrorHandler.ts"],"names":[],"mappings":"AAcA,QAAA,MAAM,kBAAkB,UAAW,GAAG,
|
|
1
|
+
{"version":3,"file":"globalErrorHandler.d.ts","sourceRoot":"","sources":["../../src/helpers/globalErrorHandler.ts"],"names":[],"mappings":"AAcA,QAAA,MAAM,kBAAkB,UAAW,GAAG,oCA6BrC,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -6,6 +6,10 @@ import { serverError } from "../httpBadResponses/serverError";
|
|
|
6
6
|
import { UnprocessableEntityError, unprocessableEntity, } from "../httpBadResponses/unprocessableEntity";
|
|
7
7
|
import { unauthorized, UnauthorizedError, } from "../httpBadResponses/unauthorized";
|
|
8
8
|
const globalErrorHandler = (error) => {
|
|
9
|
+
const showConsoleError = process.env.NODE_ENV === "development" ||
|
|
10
|
+
process.env?.SHOW_ERRORS_IN_CONSOLE === "true";
|
|
11
|
+
if (showConsoleError)
|
|
12
|
+
console.error(error);
|
|
9
13
|
if (error instanceof Response)
|
|
10
14
|
throw error;
|
|
11
15
|
switch (true) {
|
package/package.json
CHANGED
|
@@ -13,6 +13,12 @@ import {
|
|
|
13
13
|
} from "../httpBadResponses/unauthorized";
|
|
14
14
|
|
|
15
15
|
const globalErrorHandler = (error: any) => {
|
|
16
|
+
const showConsoleError =
|
|
17
|
+
process.env.NODE_ENV === "development" ||
|
|
18
|
+
process.env?.SHOW_ERRORS_IN_CONSOLE === "true";
|
|
19
|
+
|
|
20
|
+
if (showConsoleError) console.error(error);
|
|
21
|
+
|
|
16
22
|
if (error instanceof Response) throw error;
|
|
17
23
|
|
|
18
24
|
switch (true) {
|