Skip to content

Commit

Permalink
Fix crashing on empty/invalid backup file.
Browse files Browse the repository at this point in the history
Closes Unleash#17
  • Loading branch information
ivarconr committed Feb 6, 2015
1 parent 3cd0627 commit b8d9b0e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.io.*;
import java.util.Collections;
import java.util.List;
import com.google.gson.JsonParseException;

public class ToggleBackupHandlerFile implements ToggleBackupHandler {
private static final Logger LOG = LogManager.getLogger();
Expand All @@ -30,7 +31,7 @@ public ToggleCollection read() {
} catch (FileNotFoundException e) {
LOG.warn(" Unleash could not find the backup-file '" + backupFile + "'. \n" +
"This is expected behavior the first time unleash runs in a new environment.");
} catch (IOException e) {
} catch (IOException | IllegalStateException | JsonParseException e) {
LOG.error("Failed to read backup file:'{}'", backupFile, e);
}
List<FeatureToggle> emptyList = Collections.emptyList();
Expand Down

0 comments on commit b8d9b0e

Please sign in to comment.