Skip to content

Commit 455ee64

Browse files
committed
Add error log to OrderController
1 parent 5545830 commit 455ee64

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

src/credit-card-order-service/src/main/java/com/dynatrace/easytrade/creditcardorderservice/OrderController.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,19 +109,22 @@ public ResponseEntity<StandardResponse> getStatusHistory(@PathVariable Integer a
109109
public ResponseEntity<StandardResponse> getLatestStatus(@PathVariable Integer accountId) {
110110
logger.info("Getting latest status for accountId: " + accountId);
111111

112-
final Client client = openFeatureAPI.getClient();
113-
if (client.getBooleanValue("credit_card_meltdown", false)) {
114-
CountSequenceTotal(5, 2, 14);
115-
}
116-
117112
try (Connection conn = dbHelper.getConnection()) {
113+
final Client client = openFeatureAPI.getClient();
114+
if (client.getBooleanValue("credit_card_meltdown", false)) {
115+
CountSequenceTotal(5, 2, 14);
116+
}
117+
118118
Optional<CreditCardOrderStatus> status = dbHelper.getLastOrderStatusForAccountId(conn, accountId);
119119
return status
120120
.map(s -> buildResponseEntity(HttpStatus.OK, "Status found successfully.", status))
121121
.orElse(buildResponseEntity(HttpStatus.NOT_FOUND,
122122
"Status for the given account id does not exist!"));
123123
} catch (SQLException e) {
124124
return handleSQLException(e);
125+
} catch (Exception e) {
126+
logger.error("Excepiton occured", e);
127+
throw e;
125128
}
126129
}
127130

src/credit-card-order-service/src/main/resources/application.properties

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ server.port=8080
33

44
build.version={{BUILD_VERSION}}
55
build.date={{BUILD_DATE}}
6-
build.commit={{BUILD_COMMIT}}
6+
build.commit={{BUILD_COMMIT}}
7+
8+
logging.level.org.apache.catalina.core.ContainerBase=OFF

0 commit comments

Comments
 (0)