Vazkii / CMPDL

Curse Modpack Downloader
224 stars 58 forks source link

Update CMPDL.java #36

Closed Kortekaasy closed 6 years ago

Kortekaasy commented 6 years ago

By catching an IOException instead of a FileNotFoundException the tool will keep downloading a modpack when a download returns error code 403 "Forbidden"

jovaska1337 commented 6 years ago

It should be updated to: catch (IOException | FileNotFoundException e) ... in order to catch both possible exceptions.

Kortekaasy commented 6 years ago

Since IOException is the superclass of FileNotFoundException, catch (IOException e) ... will also catch a FileNotFoundException. And since you propose using catch (IOException | FileNotFoundException e) ... I guess you want the same behaviour for caught IOExceptions and caught FileNotFoundExceptions, so it makes no sense for me to update it to catch (IOException | FileNotFoundException e) ....

However, if you have another reason to use catch (IOException | FileNotFoundException e) ... instead, please enlighten me with the reason why :smiley: