Throw special exception if a time can not be parsed.
[Sone.git] / 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 {
+
+       }
 }