dce-reactkit 3.6.26 → 3.6.28
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/cjs/index.js +95 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +95 -5
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/src/helpers/genRouteHandler.ts +11 -4
package/package.json
CHANGED
|
@@ -14,6 +14,7 @@ import ParamType from '../types/ParamType';
|
|
|
14
14
|
import handleError from './handleError';
|
|
15
15
|
import handleSuccess from './handleSuccess';
|
|
16
16
|
import genErrorPage from '../html/genErrorPage';
|
|
17
|
+
import genInfoPage from '../html/genInfoPage';
|
|
17
18
|
import parseUserAgent from './parseUserAgent';
|
|
18
19
|
import getTimeInfoInET from './getTimeInfoInET';
|
|
19
20
|
|
|
@@ -407,7 +408,7 @@ const genRouteHandler = (
|
|
|
407
408
|
});
|
|
408
409
|
|
|
409
410
|
/*----------------------------------------*/
|
|
410
|
-
/*
|
|
411
|
+
/* ----- Require Course Consistency ----- */
|
|
411
412
|
/*----------------------------------------*/
|
|
412
413
|
|
|
413
414
|
// Make sure the user actually launched from the appropriate course
|
|
@@ -476,7 +477,7 @@ const genRouteHandler = (
|
|
|
476
477
|
}
|
|
477
478
|
|
|
478
479
|
/*----------------------------------------*/
|
|
479
|
-
/*
|
|
480
|
+
/* ------------- Log Handler ------------ */
|
|
480
481
|
/*----------------------------------------*/
|
|
481
482
|
|
|
482
483
|
// Create a log handler function
|
|
@@ -605,7 +606,13 @@ const genRouteHandler = (
|
|
|
605
606
|
} catch (err) {
|
|
606
607
|
// Print because we cannot store the error
|
|
607
608
|
// eslint-disable-next-line no-console
|
|
608
|
-
console.error(
|
|
609
|
+
console.error(
|
|
610
|
+
'Could not log the following:',
|
|
611
|
+
logOpts,
|
|
612
|
+
'due to this error:',
|
|
613
|
+
(err as any ?? {}).message,
|
|
614
|
+
(err as any ?? {}).stack,
|
|
615
|
+
);
|
|
609
616
|
|
|
610
617
|
// Create a dummy log to return
|
|
611
618
|
const dummyMainInfo: LogMainInfo = {
|
|
@@ -745,7 +752,7 @@ const genRouteHandler = (
|
|
|
745
752
|
body: string,
|
|
746
753
|
},
|
|
747
754
|
) => {
|
|
748
|
-
const html =
|
|
755
|
+
const html = genInfoPage(renderOpts);
|
|
749
756
|
send(html, 200);
|
|
750
757
|
};
|
|
751
758
|
|