Skip to content

Commit dec4386

Browse files
Copilotbrunoborges
andcommitted
Apply spotless formatting
Co-authored-by: brunoborges <129743+brunoborges@users.noreply.github.com>
1 parent 0e58932 commit dec4386

3 files changed

Lines changed: 14 additions & 11 deletions

File tree

src/main/java/com/github/copilot/sdk/CopilotSession.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ public String getWorkspacePath() {
163163
* <ul>
164164
* <li>Return {@code true} to continue dispatching (default behavior for
165165
* independent listeners)</li>
166-
* <li>Return {@code false} to stop dispatching (short-circuit for validation
167-
* or critical errors)</li>
166+
* <li>Return {@code false} to stop dispatching (short-circuit for validation or
167+
* critical errors)</li>
168168
* </ul>
169169
*
170170
* <p>

src/main/java/com/github/copilot/sdk/EventErrorHandler.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,20 @@
3737
* <pre>{@code
3838
* // Continue on error (log and keep dispatching)
3939
* session.setEventErrorHandler((event, exception) -> {
40-
* logger.error("Handler failed: {}", exception.getMessage(), exception);
41-
* return true; // keep dispatching
40+
* logger.error("Handler failed: {}", exception.getMessage(), exception);
41+
* return true; // keep dispatching
4242
* });
4343
*
4444
* // Short-circuit on error (stop at first failure)
4545
* session.setEventErrorHandler((event, exception) -> {
46-
* logger.error("Handler failed, stopping: {}", exception.getMessage(), exception);
47-
* return false; // stop dispatching
46+
* logger.error("Handler failed, stopping: {}", exception.getMessage(), exception);
47+
* return false; // stop dispatching
4848
* });
4949
*
5050
* // Selective: short-circuit only for critical events
5151
* session.setEventErrorHandler((event, exception) -> {
52-
* logger.error("Handler failed: {}", exception.getMessage(), exception);
53-
* return !(event instanceof SessionErrorEvent); // stop only for error events
52+
* logger.error("Handler failed: {}", exception.getMessage(), exception);
53+
* return !(event instanceof SessionErrorEvent); // stop only for error events
5454
* });
5555
* }</pre>
5656
*

src/test/java/com/github/copilot/sdk/SessionEventHandlingTest.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,8 @@ void testConcurrentDispatchFromMultipleThreads() throws Exception {
382382

383383
@Test
384384
void testDefaultErrorHandlerContinuesSilently() {
385-
// Without a custom error handler, exceptions should be caught silently (no crash, no logging)
385+
// Without a custom error handler, exceptions should be caught silently (no
386+
// crash, no logging)
386387
var received = new ArrayList<String>();
387388

388389
// First handler throws
@@ -475,9 +476,11 @@ void testErrorHandlerItselfThrowingStopsDispatch() {
475476
});
476477

477478
assertDoesNotThrow(() -> dispatchEvent(createAssistantMessageEvent("Test")));
478-
// Only one handler should have executed (dispatch stopped when error handler threw)
479+
// Only one handler should have executed (dispatch stopped when error handler
480+
// threw)
479481
int totalCalls = handler1Called.get() + handler2Called.get();
480-
assertEquals(1, totalCalls, "Only one handler should have been called (dispatch stopped when error handler threw)");
482+
assertEquals(1, totalCalls,
483+
"Only one handler should have been called (dispatch stopped when error handler threw)");
481484
} finally {
482485
sessionLogger.setLevel(originalLevel);
483486
}

0 commit comments

Comments
 (0)