-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make WebSocket close exceptions expose the status code given by the s…
…erver
- Loading branch information
1 parent
9f988f7
commit 7d87fcf
Showing
3 changed files
with
36 additions
and
6 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
client/api/src/main/java/io/smallrye/graphql/client/UnexpectedCloseException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package io.smallrye.graphql.client; | ||
|
||
/** | ||
* Marks a close WebSocket message from the server that was unexpected. | ||
*/ | ||
public class UnexpectedCloseException extends InvalidResponseException { | ||
|
||
private final int closeStatusCode; | ||
|
||
public UnexpectedCloseException(String message, int closeStatusCode) { | ||
super(message); | ||
this.closeStatusCode = closeStatusCode; | ||
} | ||
|
||
public UnexpectedCloseException(String message, Throwable cause, int closeStatusCode) { | ||
super(message, cause); | ||
this.closeStatusCode = closeStatusCode; | ||
} | ||
|
||
/** | ||
* The close status code returned by the server. | ||
*/ | ||
public int getCloseStatusCode() { | ||
return closeStatusCode; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters