Skip to content

Commit 84a9317

Browse files
committed
sonar clod fixing
1 parent a6e6dd9 commit 84a9317

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

niceday-api/service/MessagesService.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ exports.sendTextMessage = function (req, body) {
3535
.then((response) => {
3636
req.app.set('therapistId', response.user.id);
3737
req.app.set('token', response.token);
38-
chatSdk.connect(response.user.id, response.token);
38+
chatSdk.connect(response.user.id, response.token)
39+
.catch((connectError) => {
40+
throw Error(`Error during chat connection: ${connectError}`);
41+
});
3942
})
4043
.catch((loginError) => {
4144
throw Error(`Error during authentication: ${loginError}`);

niceday-broker/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,10 @@ function setupTokenRegeneration() {
111111
authSdk.login(THERAPIST_EMAIL_ADDRESS, THERAPIST_PASSWORD)
112112
.then((response) => {
113113
chatSdk.init(selectedServerEnv);
114-
chatSdk.connect(response.user.id, response.token);
114+
chatSdk.connect(response.user.id, response.token)
115+
.catch((connectError) => {
116+
throw Error(`Error during chat connection: ${connectError}`);
117+
});
115118
})
116119
.catch((error) => {
117120
throw Error(`Error during authentication: ${error}`);

0 commit comments

Comments
 (0)