Show error detailed message logs on prod
MODIFY
src/utils/Logging.ts
src/utils/Logging.ts
@@ -682,9 +682,8 @@ export default class Logging {
res.status(errorCode)
.send({
errorCode,
- errorMessage: Utils.hideShowMessage(exception.message),
- errorDetailedMessage: Utils.hideShowMessage(
- exception['params'] ? exception['params']['detailedMessages'] : null),
+ errorMessage: exception.message,
+ errorDetailedMessage: exception['params'] ? exception['params']['detailedMessages'] : null,
});
}
next();

MODIFY
src/utils/Utils.ts
src/utils/Utils.ts
@@ -974,14 +974,6 @@ export default class Utils {
return `${Utils.buildEvseURL(tenantSubdomain)}/users/${userId}`;
}
- public static hideShowMessage(message: string): string {
- // Check Prod
- if (Utils.isProductionEnv()) {
- return 'An unexpected server error occurred. Check the server\'s logs!';
- }
- return message;
- }
-
public static getRequestIP(request: http.IncomingMessage | Partial<Request>): string | string[] {
if (request['ip']) {
return request['ip'];

Show error detailed message logs on prod (#3755)

Co-authored-by: mahdibenromdhane <mahdi.benromdhane@esprit.tn>