From c6eed14db5a91bb0f384f53189d058c6d8866633 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sun, 2 Feb 2020 18:25:11 +0100 Subject: [PATCH] Catch Exceptions instead of only Throwables in JAudiotaggerParser Since JAudioTagger isn't the rock-solidest software in the world, we should catch as much things as possible --- .../player/service/metadata/JaudiotaggerParser.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/airsonic-main/src/main/java/org/airsonic/player/service/metadata/JaudiotaggerParser.java b/airsonic-main/src/main/java/org/airsonic/player/service/metadata/JaudiotaggerParser.java index c50b7e49..4f2918c5 100644 --- a/airsonic-main/src/main/java/org/airsonic/player/service/metadata/JaudiotaggerParser.java +++ b/airsonic-main/src/main/java/org/airsonic/player/service/metadata/JaudiotaggerParser.java @@ -86,7 +86,7 @@ public class JaudiotaggerParser extends MetaDataParser { AudioFile audioFile; try { audioFile = AudioFileIO.read(file); - } catch (Throwable x) { + } catch (Exception x) { LOG.warn("Error when parsing tags in " + file, x); return metaData; } @@ -229,7 +229,7 @@ public class JaudiotaggerParser extends MetaDataParser { audioFile.commit(); - } catch (Throwable x) { + } catch (Exception x) { LOG.warn("Failed to update tags for file " + file, x); throw new RuntimeException("Failed to update tags for file " + file + ". " + x.getMessage(), x); } @@ -288,4 +288,4 @@ public class JaudiotaggerParser extends MetaDataParser { Tag tag = audioFile.getTag(); return tag == null ? null : tag.getFirstArtwork(); } -} \ No newline at end of file +}