From: David ‘Bombe’ Roden Date: Thu, 24 Oct 2013 21:05:23 +0000 (+0200) Subject: Throw special exception if a time can not be parsed. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=a3ba9ccfd92c4497a40f5326254a2200e5016c82;p=Sone.git Throw special exception if a time can not be parsed. --- diff --git a/src/main/java/net/pterodactylus/sone/core/SoneParser.java b/src/main/java/net/pterodactylus/sone/core/SoneParser.java index 210fe32..1fe4794 100644 --- a/src/main/java/net/pterodactylus/sone/core/SoneParser.java +++ b/src/main/java/net/pterodactylus/sone/core/SoneParser.java @@ -186,7 +186,7 @@ public class SoneParser { } catch (NumberFormatException nfe1) { /* TODO - mark Sone as bad. */ logger.log(Level.WARNING, String.format("Downloaded post for Sone %s with invalid time: %s", sone, postTime)); - return null; + throw new MalformedTime(); } } } @@ -359,4 +359,8 @@ public class SoneParser { public static class DuplicateField extends RuntimeException { } + + public static class MalformedTime extends RuntimeException { + + } }