Skip to content

Commit

Permalink
[misc] enrich exception error logs with exception obj (#1659)
Browse files Browse the repository at this point in the history
Co-authored-by: Anshul Singh <[email protected]>
  • Loading branch information
anshul98ks123 and Anshul Singh authored Nov 18, 2024
1 parent 3ecb88d commit b9ddc2b
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ private void close(final ThirdEyeDataSource dataSource) {
try {
dataSource.close();
} catch (final Exception e) {
LOG.error("Datasource {} was not flushed gracefully.", dataSource.getName());
LOG.error("Datasource {} was not flushed gracefully.", dataSource.getName(), e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private void initTables(final Connection connection) throws SQLException {
try {
dataTableToSqlAdapter.loadTables(connection, datatables);
} catch (final SQLException e) {
LOG.error("Failed to load tables");
LOG.error("Failed to load tables", e);
throw e;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ private ThirdEyeResultSetGroup executeSQL(final PinotQuery pinotQuery) throws Ex
return thirdEyeResultSetGroup;
} catch (final ExecutionException e) {
LOG.error("Failed to execute SQL: {} with options {}", pinotQuery.getQuery(),
pinotQuery.getOptions());
pinotQuery.getOptions(), e);
LOG.error("queryCache.stats: {}", queryCache.stats());
throw e;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ private static SSLContext httpsSslContext() {
.build();
} catch (final NoSuchAlgorithmException | KeyManagementException | KeyStoreException e) {
// This section shouldn't happen because we use Accept All Strategy
LOG.error("Failed to generate SSL context for Pinot in https.");
LOG.error("Failed to generate SSL context for Pinot in https.", e);
throw new RuntimeException(e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ private void processAlert(final AlertDTO alert) {
startJob(alert, detectionJob);
}
} catch (final Exception e) {
LOG.error("Error creating/updating job key for detection config {}", alert.getId());
LOG.error("Error creating/updating job key for detection config {}", alert.getId(), e);
}
}

Expand All @@ -136,7 +136,7 @@ private void processScheduledJobs() throws SchedulerException {
stopJob(jobKey);
}
} catch (final Exception e) {
LOG.error("Error removing job key {}", jobKey);
LOG.error("Error removing job key {}", jobKey, e);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,8 @@ private long minimumLastTimestamp(final ThirdEyePrincipal principal, final Alert
// replay from JAN 1 2000 because replaying from 1970 is too slow with small granularity
LOG.error("Could not fetch insights for alert {}. Using the minimum time allowed. {}",
dto,
minimumOnboardingStartTime);
minimumOnboardingStartTime,
e);
return minimumOnboardingStartTime;
}
}
Expand Down

0 comments on commit b9ddc2b

Please sign in to comment.