[JAVA-5179] Make Stream.open/openAsync fail with IOException instead of MongoSocketOpenException Created: 26/Sep/23 Updated: 18/Dec/23 |
|
| Status: | Backlog |
| Project: | Java Driver |
| Component/s: | Error Handling |
| Affects Version/s: | None |
| Fix Version/s: | 5.1.0 |
| Type: | Improvement | Priority: | Unknown |
| Reporter: | Valentin Kavalenka | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
When Stream.open/openAsync fail with IOException, we can translate that exception into MongoInterruptedException/MongoSocketOpenException/MongoInternalException in InternalStreamConnection (a single place for all Stream implementations) similarly to how it's done for Stream.read/readAsync/write/writeAsync in InternalStreamConnection.translateReadException/translateWriteException. |
| Comments |
| Comment by Jeffrey Yemin [ 18/Dec/23 ] |
|
Pushed to 5.1.0 as this is not a breaking change, just something we can do now that it no longer is. |
| Comment by Jeffrey Yemin [ 27/Sep/23 ] |
|
Yes, it's fine to leave it as is for now. I was just surprised about the signature. We allowed it to throw IOException and then didn't take advantage of it.l |
| Comment by Valentin Kavalenka [ 27/Sep/23 ] |
|
It does. I assumed you just did not want us to mess with it further while it is part of API. |
| Comment by Jeffrey Yemin [ 27/Sep/23 ] |
|
Surprisingly, the Stream#open method already declares that it throws IOException. |