@churchapps/apphelper 0.3.14 → 0.3.15
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":"ErrorHelper.d.ts","sourceRoot":"","sources":["../../src/helpers/ErrorHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAIhF,qBAAa,WAAW;
|
|
1
|
+
{"version":3,"file":"ErrorHelper.d.ts","sourceRoot":"","sources":["../../src/helpers/ErrorHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAIhF,qBAAa,WAAW;IAEvB,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,eAAgB,MAAM,sBAAsB,iCAAiC,iBAAiB,KAAK,IAAI,UAGjH;IAED,MAAM,CAAC,QAAQ,cAAe,MAAM,WAAW,MAAM,WAAW,MAAM,UAoBrE;CAED"}
|
|
@@ -27,7 +27,7 @@ ErrorHelper.logError = (errorType, message, details) => {
|
|
|
27
27
|
console.log("ERROR LOG", log);
|
|
28
28
|
if (log.errorType === "401" && log.message.indexOf("/users/login") > -1)
|
|
29
29
|
return;
|
|
30
|
-
ApiHelper_1.ApiHelper.postAnonymous("/
|
|
30
|
+
ApiHelper_1.ApiHelper.postAnonymous("/clientErrors", [log], "MembershipApi");
|
|
31
31
|
if (_a.customErrorHandler)
|
|
32
32
|
_a.customErrorHandler(log);
|
|
33
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorHelper.js","sourceRoot":"","sources":["../../src/helpers/ErrorHelper.ts"],"names":[],"mappings":";;;;AACA,2CAAwC;AAGxC,MAAa,WAAW;;AAAxB,
|
|
1
|
+
{"version":3,"file":"ErrorHelper.js","sourceRoot":"","sources":["../../src/helpers/ErrorHelper.ts"],"names":[],"mappings":";;;;AACA,2CAAwC;AAGxC,MAAa,WAAW;;AAAxB,kCAgCC;;AA3BO,gBAAI,GAAG,CAAC,UAAwC,EAAE,kBAAyD,EAAE,EAAE;IACrH,EAAW,CAAC,UAAU,GAAG,UAAU,CAAC;IACpC,EAAW,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;AACrD,CAAC,AAHU,CAGV;AAEM,oBAAQ,GAAG,CAAC,SAAiB,EAAE,OAAe,EAAE,OAAe,EAAE,EAAE;IACzE,IAAI,EAAI,CAAC,UAAU,EAAE;QACpB,MAAM,IAAI,GAAG,EAAI,CAAC,UAAU,EAAE,CAAC;QAC/B,MAAM,GAAG,GAAsB;YAC9B,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,SAAS,EAAE,SAAS;YACpB,OAAO,EAAE,OAAO;YAChB,OAAO,EAAE,OAAO;SAChB,CAAA;QAED,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;QAE9B,IAAI,GAAG,CAAC,SAAS,KAAK,KAAK,IAAI,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;YAAE,OAAO;QAChF,qBAAS,CAAC,aAAa,CAAC,eAAe,EAAE,CAAC,GAAG,CAAC,EAAE,eAAe,CAAC,CAAC;QACjE,IAAI,EAAW,CAAC,kBAAkB;YAAE,EAAW,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;KACxE;AACF,CAAC,AApBc,CAoBd"}
|
package/package.json
CHANGED
|
@@ -4,35 +4,34 @@ import { ApiHelper } from "./ApiHelper";
|
|
|
4
4
|
|
|
5
5
|
export class ErrorHelper {
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
7
|
+
static getAppData: () => { churchId: string, userId: string, originUrl: string, application: string };
|
|
8
|
+
static customErrorHandler: (errorLog: ErrorLogInterface) => void;
|
|
9
|
+
|
|
10
|
+
static init = (getAppData: () => ErrrorAppDataInterface, customErrorHandler: (errorLog: ErrorLogInterface) => void) => {
|
|
11
|
+
ErrorHelper.getAppData = getAppData;
|
|
12
|
+
ErrorHelper.customErrorHandler = customErrorHandler;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
static logError = (errorType: string, message: string, details: string) => {
|
|
16
|
+
if (this.getAppData) {
|
|
17
|
+
const data = this.getAppData();
|
|
18
|
+
const log: ErrorLogInterface = {
|
|
19
|
+
application: data.application,
|
|
20
|
+
errorTime: new Date(),
|
|
21
|
+
userId: data.userId,
|
|
22
|
+
churchId: data.churchId,
|
|
23
|
+
originUrl: data.originUrl,
|
|
24
|
+
errorType: errorType,
|
|
25
|
+
message: message,
|
|
26
|
+
details: details
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
console.log("ERROR LOG", log);
|
|
30
|
+
|
|
31
|
+
if (log.errorType === "401" && log.message.indexOf("/users/login") > -1) return;
|
|
32
|
+
ApiHelper.postAnonymous("/clientErrors", [log], "MembershipApi");
|
|
33
|
+
if (ErrorHelper.customErrorHandler) ErrorHelper.customErrorHandler(log);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
37
36
|
|
|
38
37
|
}
|