refactor: catch `Throwable`, not `Exception`

feat/data-edit-commands
William 1 year ago
parent 55173be04b
commit d4f61bd646
No known key found for this signature in database

@ -143,7 +143,7 @@ public class MpdbMigrator extends Migrator {
}); });
plugin.log(Level.INFO, "Migration complete for " + dataToMigrate.size() + " users in " + ((System.currentTimeMillis() - startTime) / 1000) + " seconds!"); plugin.log(Level.INFO, "Migration complete for " + dataToMigrate.size() + " users in " + ((System.currentTimeMillis() - startTime) / 1000) + " seconds!");
return true; return true;
} catch (Exception e) { } catch (Throwable e) {
plugin.log(Level.SEVERE, "Error while migrating data: " + e.getMessage() + " - are your source database credentials correct?"); plugin.log(Level.SEVERE, "Error while migrating data: " + e.getMessage() + " - are your source database credentials correct?");
return false; return false;
} }

@ -115,7 +115,7 @@ public class DataDumper {
} else { } else {
return "(Failed to upload to logs site, got: " + connection.getResponseCode() + ")"; return "(Failed to upload to logs site, got: " + connection.getResponseCode() + ")";
} }
} catch (Exception e) { } catch (Throwable e) {
plugin.log(Level.SEVERE, "Failed to upload data to logs site", e); plugin.log(Level.SEVERE, "Failed to upload data to logs site", e);
} }
return "(Failed to upload to logs site)"; return "(Failed to upload to logs site)";

Loading…
Cancel
Save