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
This commit is contained in:
+3
-3
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user