Skip to content

Commit cca3e3f

Browse files
committed
Use more specific exception
1 parent ea40163 commit cca3e3f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/utils/ProtoBuilder.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import java.io.ByteArrayOutputStream;
44
import java.io.IOException;
5+
import java.io.UncheckedIOException;
56
import java.net.URLEncoder;
67
import java.nio.charset.StandardCharsets;
78
import java.util.Base64;
@@ -39,7 +40,7 @@ private void writeVarint(final long val) {
3940
}
4041
}
4142
} catch (final IOException e) {
42-
throw new RuntimeException(e);
43+
throw new UncheckedIOException(e);
4344
}
4445
}
4546

@@ -66,7 +67,7 @@ public void bytes(final int field, final byte[] bytes) {
6667
try {
6768
byteBuffer.write(bytes);
6869
} catch (final IOException e) {
69-
throw new RuntimeException(e);
70+
throw new UncheckedIOException(e);
7071
}
7172
}
7273
}

0 commit comments

Comments
 (0)