Prechádzať zdrojové kódy

Replaced "assert" with IllegalStateException

JaniruTEC 4 rokov pred
rodič
commit
6f542ac8b8

+ 2 - 2
main/commons/src/main/java/org/cryptomator/common/mountpoint/CustomMountPointChooser.java

@@ -46,11 +46,11 @@ public class CustomMountPointChooser implements MountPointChooser {
 			case NONE -> {
 				//Requirement "NONE" doesn't make any sense here.
 				//No need to prepare/verify a Mountpoint without requiring one...
-				assert false : "Illegal MountPointRequirement";
+				throw new InvalidMountPointException(new IllegalStateException("Illegal MountPointRequirement"));
 			}
 			default -> {
 				//Currently the case for "PARENT_OPT_MOUNT_POINT"
-				assert false : "Not implemented";
+				throw new InvalidMountPointException(new IllegalStateException("Not implemented"));
 			}
 		}
 		LOG.debug("Successfully checked custom mount point: {}", mountPoint);