I get this piece of code from a game book. The author explains that it will open a music file
public Music newMusic(String filename) {
try {
AssetFileDescriptor assetDescriptor = assets.openFd(filename);
return new AndroidMusic(assetDescriptor);
} catch (IOException e) {
throw new RuntimeException("Couldn't load music '" + filename + "'");
}
}
The method AssetFileDescriptor.openFd(filename) throws a IOException.
My question is: why do we need throw a RuntimeException message instead of IOException message?
throws IOException.