Skip to content

Commit

Permalink
#829 Wrap allocation errors in KryoException when reading and writi…
Browse files Browse the repository at this point in the history
…ng fields
  • Loading branch information
theigl committed May 26, 2021
1 parent 3bf0a0a commit 1d72a60
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -108,7 +108,7 @@ public void write (Kryo kryo, Output output, T object) {
fields[i].write(output, object);
} catch (KryoException e) {
throw e;
} catch (Exception e) {
} catch (OutOfMemoryError | Exception e) {
throw new KryoException("Error writing " + fields[i] + " at position " + output.position(), e);
}
}
Expand All @@ -128,8 +128,8 @@ public T read (Kryo kryo, Input input, Class<? extends T> type) {
try {
fields[i].read(input, object);
} catch (KryoException e) {
throw e;
} catch (Exception e) {
throw e;
} catch (OutOfMemoryError | Exception e) {
throw new KryoException("Error reading " + fields[i] + " at position " + input.position(), e);
}
}
Expand Down

0 comments on commit 1d72a60

Please sign in to comment.