From a3ba9ccfd92c4497a40f5326254a2200e5016c82 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 24 Oct 2013 23:05:23 +0200 Subject: [PATCH] Throw special exception if a time can not be parsed. --- src/main/java/net/pterodactylus/sone/core/SoneParser.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 { + + } } -- 2.7.4