[libgames-support] Further improve error handling in load_scores_from_file



commit b132cec25fe319db63e909013803efadbea1a2ac
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Sun Feb 14 16:25:40 2016 -0600

    Further improve error handling in load_scores_from_file

 games/scores/context.vala |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/games/scores/context.vala b/games/scores/context.vala
index a61bebc..54ae34b 100644
--- a/games/scores/context.vala
+++ b/games/scores/context.vala
@@ -276,7 +276,8 @@ public class Context : Object
 
             if (tokens.length < 2)
             {
-                throw new FileError.FAILED ("Failed to parse %s for scores.", filename);
+                warning ("Failed to read malformed score %s in %s.", line, filename);
+                continue;
             }
 
             var score_value = long.parse (tokens[0]);
@@ -285,7 +286,7 @@ public class Context : Object
             if (score_value == 0 && tokens[0] != "0" ||
                 time == 0 && tokens[1] != "0")
             {
-                warning ("Failed to read malformed score %s in %s", line, filename);
+                warning ("Failed to read malformed score %s in %s.", line, filename);
                 continue;
             }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]