You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am surprised that the main method throws an IOException:
public String generate() throws IOException {
Ksuid.KsuidGenerator uid = new Ksuid.KsuidGenerator(random);
return uid.nextId();
}
As I understand it, this exception is rethrown because of the ByteArrayOutputStream write operation, although in this case all Streams are internal to the program, so appart from some serious runtime problems, this should never happen, and if it does there's probably not much to do about it at that point.
=> would you welcome a PR with something like:
public String generate() {
try {
Ksuid.KsuidGenerator uid = new Ksuid.KsuidGenerator(random);
return uid.nextId();
} catch (IOException e) {
throw new RuntimeException("unexpected error: failed to write to internal buffers", e);
}
}
?
The text was updated successfully, but these errors were encountered:
Thanks for open sourcing this!
I am surprised that the main method throws an
IOException
:As I understand it, this exception is rethrown because of the
ByteArrayOutputStream
write operation, although in this case all Streams are internal to the program, so appart from some serious runtime problems, this should never happen, and if it does there's probably not much to do about it at that point.=> would you welcome a PR with something like:
?
The text was updated successfully, but these errors were encountered: