mirror of
				https://github.com/packwiz/packwiz-installer.git
				synced 2025-10-31 19:04:32 +01:00 
			
		
		
		
	Clarify error message for missing index file
This commit is contained in:
		| @@ -21,7 +21,6 @@ import link.infra.packwiz.installer.ui.IUserInterface.ExceptionListResult | |||||||
| import link.infra.packwiz.installer.ui.data.InstallProgress | import link.infra.packwiz.installer.ui.data.InstallProgress | ||||||
| import link.infra.packwiz.installer.util.Log | import link.infra.packwiz.installer.util.Log | ||||||
| import link.infra.packwiz.installer.util.ifletOrErr | import link.infra.packwiz.installer.util.ifletOrErr | ||||||
| import link.infra.packwiz.installer.util.ifletOrWarn |  | ||||||
| import okio.buffer | import okio.buffer | ||||||
| import java.io.FileNotFoundException | import java.io.FileNotFoundException | ||||||
| import java.io.FileReader | import java.io.FileReader | ||||||
| @@ -29,7 +28,6 @@ import java.io.FileWriter | |||||||
| import java.io.IOException | import java.io.IOException | ||||||
| import java.nio.file.Files | import java.nio.file.Files | ||||||
| import java.nio.file.Paths | import java.nio.file.Paths | ||||||
| import java.util.* |  | ||||||
| import java.util.concurrent.CompletionService | import java.util.concurrent.CompletionService | ||||||
| import java.util.concurrent.ExecutionException | import java.util.concurrent.ExecutionException | ||||||
| import java.util.concurrent.ExecutorCompletionService | import java.util.concurrent.ExecutorCompletionService | ||||||
| @@ -194,7 +192,8 @@ class UpdateManager internal constructor(private val opts: Options, val ui: IUse | |||||||
| 			handleCancellation() | 			handleCancellation() | ||||||
| 		} | 		} | ||||||
| 		try { | 		try { | ||||||
| 			ifletOrWarn(pf.index, "No index file found") { index -> | 			// TODO: switch to OkHttp for better redirect handling | ||||||
|  | 			ui.ifletOrErr(pf.index, "No index file found, or the pack file is empty; note that Java doesn't automatically follow redirects from HTTP to HTTPS (and may cause this error)") { index -> | ||||||
| 				ui.ifletOrErr(index.hashFormat, index.hash, "Pack has no hash or hashFormat for index") { hashFormat, hash -> | 				ui.ifletOrErr(index.hashFormat, index.hash, "Pack has no hash or hashFormat for index") { hashFormat, hash -> | ||||||
| 					ui.ifletOrErr(getNewLoc(opts.downloadURI, index.file), "Pack has invalid index file: " + index.file) { newLoc -> | 					ui.ifletOrErr(getNewLoc(opts.downloadURI, index.file), "Pack has invalid index file: " + index.file) { newLoc -> | ||||||
| 						processIndex( | 						processIndex( | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user