static InputStream urlConnection_getInputStream(URLConnection con) throws IOException { UnknownHostException lastException = null; repeat 2 { try { if (con cast HttpURLConnection) if (con.getResponseCode() == 500) throw new IOException(joinNemptiesWithColonSpace("Server code 500", tryToReadErrorStreamFromURLConnection(con))); ret con.getInputStream(); } catch (UnknownHostException e) { lastException = e; print("Retrying because of: " + e); continue; } } throw lastException; }
Began life as a copy of #1022757
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
| Snippet ID: | #1033015 |
| Snippet name: | urlConnection_getInputStream - we really don't need this anymore (with DNS retry, drop-in replacement for URLConnection.getInputStream) |
| Eternal ID of this version: | #1033015/1 |
| Text MD5: | fb89c2ffc066ecd51fa78de0e0f516d9 |
| Author: | stefan |
| Category: | javax / networking |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2021-10-11 11:04:54 |
| Source code size: | 563 bytes / 16 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 340 / 359 |
| Referenced in: | -