@churchapps/helpers 1.1.0 → 1.1.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/dist/ErrorHelper.d.ts.map +1 -1
- package/dist/ErrorHelper.js +2 -2
- package/dist/ErrorHelper.js.map +1 -1
- package/package.json +1 -1
- package/src/ErrorHelper.ts +12 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorHelper.d.ts","sourceRoot":"","sources":["../src/ErrorHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAI9E,qBAAa,WAAW;IAEtB,MAAM,CAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"ErrorHelper.d.ts","sourceRoot":"","sources":["../src/ErrorHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAI9E,qBAAa,WAAW;IAEtB,MAAM,CAAC,UAAU,EAAE,MAAM;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;IACtG,MAAM,CAAC,kBAAkB,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAEjE,MAAM,CAAC,IAAI,GAAI,YAAY,MAAM,qBAAqB,EAAE,oBAAoB,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,UAGhH;IAED,MAAM,CAAC,QAAQ,GAAI,WAAW,MAAM,EAAE,SAAS,MAAM,EAAE,SAAS,MAAM,UAqBrE;CAGF"}
|
package/dist/ErrorHelper.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ErrorHelper = void 0;
|
|
4
|
-
const ApiHelper_1 = require("./ApiHelper");
|
|
5
4
|
class ErrorHelper {
|
|
6
5
|
static getAppData;
|
|
7
6
|
static customErrorHandler;
|
|
@@ -24,7 +23,8 @@ class ErrorHelper {
|
|
|
24
23
|
};
|
|
25
24
|
if (log.errorType === "401" && log.message.indexOf("/users/login") > -1)
|
|
26
25
|
return;
|
|
27
|
-
|
|
26
|
+
//temporarily disabled error logging
|
|
27
|
+
//ApiHelper.postAnonymous("/errors", [log], "MembershipApi");
|
|
28
28
|
if (ErrorHelper.customErrorHandler)
|
|
29
29
|
ErrorHelper.customErrorHandler(log);
|
|
30
30
|
}
|
package/dist/ErrorHelper.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorHelper.js","sourceRoot":"","sources":["../src/ErrorHelper.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"ErrorHelper.js","sourceRoot":"","sources":["../src/ErrorHelper.ts"],"names":[],"mappings":";;;AAIA,MAAa,WAAW;IAEtB,MAAM,CAAC,UAAU,CAAqF;IACtG,MAAM,CAAC,kBAAkB,CAAwC;IAEjE,MAAM,CAAC,IAAI,GAAG,CAAC,UAAuC,EAAE,kBAAyD,EAAE,EAAE;QACnH,WAAW,CAAC,UAAU,GAAG,UAAU,CAAC;QACpC,WAAW,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;IACtD,CAAC,CAAA;IAED,MAAM,CAAC,QAAQ,GAAG,CAAC,SAAiB,EAAE,OAAe,EAAE,OAAe,EAAE,EAAE;QAGxE,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;YAC/B,MAAM,GAAG,GAAsB;gBAC7B,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,SAAS,EAAE,IAAI,IAAI,EAAE;gBACrB,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,SAAS,EAAE,IAAI,CAAC,SAAS;gBACzB,SAAS,EAAE,SAAS;gBACpB,OAAO,EAAE,OAAO;gBAChB,OAAO,EAAE,OAAO;aACjB,CAAA;YAED,IAAI,GAAG,CAAC,SAAS,KAAK,KAAK,IAAI,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;gBAAE,OAAO;YAChF,oCAAoC;YACpC,6DAA6D;YAC7D,IAAI,WAAW,CAAC,kBAAkB;gBAAE,WAAW,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;QAC1E,CAAC;IACH,CAAC,CAAA;;AA/BH,kCAkCC"}
|
package/package.json
CHANGED
package/src/ErrorHelper.ts
CHANGED
|
@@ -4,19 +4,20 @@ import { ApiHelper } from "./ApiHelper";
|
|
|
4
4
|
|
|
5
5
|
export class ErrorHelper {
|
|
6
6
|
|
|
7
|
-
static getAppData:() => { churchId: string, userId: string, originUrl: string, application: string};
|
|
8
|
-
static customErrorHandler:(errorLog:ErrorLogInterface) => void;
|
|
7
|
+
static getAppData: () => { churchId: string, userId: string, originUrl: string, application: string };
|
|
8
|
+
static customErrorHandler: (errorLog: ErrorLogInterface) => void;
|
|
9
9
|
|
|
10
|
-
static init = (getAppData:() => ErrorAppDataInterface, customErrorHandler:(errorLog:ErrorLogInterface) => void) => {
|
|
10
|
+
static init = (getAppData: () => ErrorAppDataInterface, customErrorHandler: (errorLog: ErrorLogInterface) => void) => {
|
|
11
11
|
ErrorHelper.getAppData = getAppData;
|
|
12
12
|
ErrorHelper.customErrorHandler = customErrorHandler;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
static logError = (errorType:string, message:string, details:string) => {
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
static logError = (errorType: string, message: string, details: string) => {
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
if (this.getAppData) {
|
|
18
19
|
const data = this.getAppData();
|
|
19
|
-
const log:ErrorLogInterface = {
|
|
20
|
+
const log: ErrorLogInterface = {
|
|
20
21
|
application: data.application,
|
|
21
22
|
errorTime: new Date(),
|
|
22
23
|
userId: data.userId,
|
|
@@ -27,10 +28,12 @@ export class ErrorHelper {
|
|
|
27
28
|
details: details
|
|
28
29
|
}
|
|
29
30
|
|
|
30
|
-
if (log.errorType==="401" && log.message.indexOf("/users/login")
|
|
31
|
-
|
|
31
|
+
if (log.errorType === "401" && log.message.indexOf("/users/login") > -1) return;
|
|
32
|
+
//temporarily disabled error logging
|
|
33
|
+
//ApiHelper.postAnonymous("/errors", [log], "MembershipApi");
|
|
32
34
|
if (ErrorHelper.customErrorHandler) ErrorHelper.customErrorHandler(log);
|
|
33
35
|
}
|
|
34
36
|
}
|
|
35
37
|
|
|
38
|
+
|
|
36
39
|
}
|