Throw special exception if a time can not be parsed.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 24 Oct 2013 21:05:23 +0000 (23:05 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 28 Feb 2014 21:25:36 +0000 (22:25 +0100)
src/main/java/net/pterodactylus/sone/core/SoneParser.java

index 210fe32..1fe4794 100644 (file)
@@ -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 {
+
+       }
 }