aboutsummaryrefslogtreecommitdiffstats
path: root/document
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2020-09-29 20:50:09 +0200
committerJon Marius Venstad <venstad@gmail.com>2020-09-30 10:23:35 +0200
commit574989151329e44cd49b510b8e53aa822ec2b413 (patch)
treeb7e785675f88cbd7976ee7e6e4215e6c9c500e10 /document
parent24e874d8cbc5d132fce1811e25721c8b9c888b1e (diff)
Throw IllegalArgumentException on bad input, rather than RuntimeException
Diffstat (limited to 'document')
-rw-r--r--document/src/main/java/com/yahoo/document/json/TokenBuffer.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/document/src/main/java/com/yahoo/document/json/TokenBuffer.java b/document/src/main/java/com/yahoo/document/json/TokenBuffer.java
index e20845bfa54..88353139b0f 100644
--- a/document/src/main/java/com/yahoo/document/json/TokenBuffer.java
+++ b/document/src/main/java/com/yahoo/document/json/TokenBuffer.java
@@ -129,7 +129,7 @@ public class TokenBuffer {
add(t, tokens.getCurrentName(), tokens.getText());
} catch (IOException e) {
// TODO something sane
- throw new RuntimeException(e);
+ throw new IllegalArgumentException(e);
}
}
@@ -138,7 +138,7 @@ public class TokenBuffer {
return tokens.nextValue();
} catch (IOException e) {
// TODO something sane
- throw new RuntimeException(e);
+ throw new IllegalArgumentException(e);
}
}