Skip to content
Snippets Groups Projects
Commit 48dc259a authored by FORESTIER Fabien's avatar FORESTIER Fabien
Browse files

Make sure errors are displayed as string in logger to avoid errors

parent 29c82ce1
No related branches found
No related tags found
1 merge request!3Version 2.1.3
Pipeline #2621 passed
{
"name": "service-authentication",
"version": "2.1.2",
"version": "2.1.3",
"description": " ",
"author": "",
"license": "MIT",
......
......@@ -84,7 +84,7 @@ export class AuthenticationService {
try {
const body = await request.post(`${this.conf.legacyMiddlewareUrl}/user/login`).form(loginForm).catch((error) => {
this.logger.error(
`Error while making the login request to middleware legacy auth.`, error, `${AuthenticationService.name} - ${this.legacyLogin.name}`,
`Error while making the login request to middleware legacy auth.`, `${error}`, `${AuthenticationService.name} - ${this.legacyLogin.name}`,
);
throw new InternalServerErrorException({ error, message: 'Error while making the login request to middleware legacy auth.' });
});
......@@ -129,7 +129,7 @@ export class AuthenticationService {
json: form,
}).catch((error) => {
this.logger.error(
`Error while making the update request to middleware legacy auth.`, error, `${AuthenticationService.name} - ${this.updateUserInfo.name}`,
`Error while making the update request to middleware legacy auth.`, `${error}`, `${AuthenticationService.name} - ${this.updateUserInfo.name}`,
);
throw new InternalServerErrorException({ error, message: 'Error while making the update request to middleware legacy auth.' });
});
......@@ -275,7 +275,7 @@ export class AuthenticationService {
},
}).catch((error) => {
this.logger.error(
`Error while getting user info from middleware legacy auth.`, error, `${AuthenticationService.name} - ${this.getUserInfoLegacy.name}`,
`Error while getting user info from middleware legacy auth.`, `${error}`, `${AuthenticationService.name} - ${this.getUserInfoLegacy.name}`,
);
throw new InternalServerErrorException({ error, message: 'Error while getting user info from middleware legacy auth.' });
});
......@@ -319,7 +319,7 @@ export class AuthenticationService {
try {
const res = await request.put(`${this.conf.kongConsumers}/${email}`).form({ username: email }).catch((error) => {
this.logger.error(
`Error while creating/updating user in kong.`, error, `${AuthenticationService.name} - ${this.createOrUpdateKongUser.name}`,
`Error while creating/updating user in kong.`, `${error}`, `${AuthenticationService.name} - ${this.createOrUpdateKongUser.name}`,
);
throw new InternalServerErrorException({ error, message: 'Error while creating/updating user in kong.' });
});
......@@ -336,7 +336,7 @@ export class AuthenticationService {
try {
let credentials = await request.get(`${this.conf.kongConsumers}/${email}/jwt`).catch((error) => {
this.logger.error(
`Error while getting the user's JWT credential from kong.`, error, `${AuthenticationService.name} - ${this.getUserJWTCredential.name}`,
`Error while getting the user's JWT credential from kong.`, `${error}`, `${AuthenticationService.name} - ${this.getUserJWTCredential.name}`,
);
throw new InternalServerErrorException({ error, message: 'Error while getting the user\'s JWT credential from kong.' });
});
......@@ -366,7 +366,7 @@ export class AuthenticationService {
try {
let credentials = await request.post(`${this.conf.kongConsumers}/${email}/jwt`).catch((error) => {
this.logger.error(
`Error while generating JWT credentials.`, error, `${AuthenticationService.name} - ${this.generateUserJWTCredential.name}`,
`Error while generating JWT credentials.`, `${error}`, `${AuthenticationService.name} - ${this.generateUserJWTCredential.name}`,
);
throw new InternalServerErrorException({ error, message: 'Error while generating JWT credentials..' });
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment