Skip to content

Commit b517156

Browse files
author
Alena Prokharchyk
committed
CLOUDSTACK-7039: don't log exception stackTrace when catch sql exception on system/admin user/account insert
1 parent 5a96d8e commit b517156

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

server/src/com/cloud/server/ConfigurationServerImpl.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ public void doInTransactionWithoutResult(TransactionStatus status) {
464464
PreparedStatement stmt = txn.prepareAutoCloseStatement(insertSql);
465465
stmt.executeUpdate();
466466
} catch (SQLException ex) {
467-
s_logger.debug("Caught SQLException when inserting system account ", ex);
467+
s_logger.debug("Caught exception when inserting system account: " + ex.getMessage());
468468
}
469469
// insert system user
470470
insertSql = "INSERT INTO `cloud`.`user` (id, uuid, username, password, account_id, firstname, lastname, created, user.default)"
@@ -474,7 +474,7 @@ public void doInTransactionWithoutResult(TransactionStatus status) {
474474
PreparedStatement stmt = txn.prepareAutoCloseStatement(insertSql);
475475
stmt.executeUpdate();
476476
} catch (SQLException ex) {
477-
s_logger.debug("Caught SQLException when inserting system user ", ex);
477+
s_logger.debug("Caught SQLException when inserting system user: " + ex.getMessage());
478478
}
479479

480480
// insert admin user, but leave the account disabled until we set a
@@ -491,7 +491,7 @@ public void doInTransactionWithoutResult(TransactionStatus status) {
491491
PreparedStatement stmt = txn.prepareAutoCloseStatement(insertSql);
492492
stmt.executeUpdate();
493493
} catch (SQLException ex) {
494-
s_logger.debug("Caught SQLException when creating admin account ", ex);
494+
s_logger.debug("Caught SQLException when creating admin account: " + ex.getMessage());
495495
}
496496

497497
// now insert the user
@@ -502,7 +502,7 @@ public void doInTransactionWithoutResult(TransactionStatus status) {
502502
PreparedStatement stmt = txn.prepareAutoCloseStatement(insertSql);
503503
stmt.executeUpdate();
504504
} catch (SQLException ex) {
505-
s_logger.debug("Caught SQLException when inserting user ", ex);
505+
s_logger.debug("Caught SQLException when inserting admin user: " + ex.getMessage());
506506
}
507507

508508
try {

0 commit comments

Comments
 (0)