Let StringUtils throw FormatException instead of IllegalArgumentException

This commit is contained in:
Sebastian Kürten
2022-06-29 13:16:37 +02:00
parent ddb759dbb8
commit 4bca9decc1
14 changed files with 91 additions and 52 deletions

View File

@@ -2,6 +2,7 @@ package org.briarproject.bramble.api.mailbox;
import com.fasterxml.jackson.annotation.JsonValue;
import org.briarproject.bramble.api.FormatException;
import org.briarproject.bramble.api.UniqueId;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
@@ -32,7 +33,7 @@ public abstract class MailboxId extends UniqueId {
}
try {
return fromHexString(token);
} catch (IllegalArgumentException e) {
} catch (FormatException e) {
throw new InvalidMailboxIdException();
}
}