Skip to content

Commit

Permalink
fix: add more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
valeriansaliou committed Aug 3, 2024
1 parent 6e2c843 commit 7ad8b66
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/broker/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,8 @@ class BrokerClient {
try {
// Connect client
await this.client.connect(jid, password);

logger.info("Could connect: success");
} catch (error) {
// Mark as disconnected
Store.$session.setConnected(false);
Expand All @@ -272,19 +274,19 @@ class BrokerClient {
if (error instanceof ProseConnectionError) {
switch (error.type) {
case ProseConnectionErrorType.TimedOut: {
logger.error("Cannot connect: timed out");
logger.error("Could not connect: timed out");

break;
}

case ProseConnectionErrorType.InvalidCredentials: {
logger.error("Cannot connect: invalid credentials");
logger.error("Could not connect: invalid credentials");

break;
}

case ProseConnectionErrorType.Generic: {
logger.error("Cannot connect: other reason");
logger.error("Could not connect: other reason");

break;
}
Expand Down

0 comments on commit 7ad8b66

Please sign in to comment.