mirror of
https://github.com/keylase/nvidia-patch.git
synced 2024-11-09 19:48:20 +00:00
autopatch: Ensure non-zero retval for missing installer
Signed-off-by: Jai Luthra <me@jailuthra.in>
This commit is contained in:
parent
3b52cbf2c3
commit
2f11563e5c
@ -90,6 +90,8 @@ class MultipleOccurencesException(Exception):
|
|||||||
class UnknownPlatformException(Exception):
|
class UnknownPlatformException(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
class InstallerNotFoundException(Exception):
|
||||||
|
pass
|
||||||
|
|
||||||
class ExtractedTarget:
|
class ExtractedTarget:
|
||||||
name = None
|
name = None
|
||||||
@ -229,14 +231,11 @@ def patch_flow(installer_file, search, replacement, target, target_name, patch_n
|
|||||||
print(f"Using downloaded file in '{file_path}'")
|
print(f"Using downloaded file in '{file_path}'")
|
||||||
installer_file = file_path
|
installer_file = file_path
|
||||||
except (urllib.error.URLError, Exception) as e:
|
except (urllib.error.URLError, Exception) as e:
|
||||||
print(f"Failed to download the file: {e}")
|
raise InstallerNotFoundException(f"Failed to download the file: {e}")
|
||||||
return
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"An error occurred during download: {str(e)}")
|
raise InstallerNotFoundException(f"An error occurred during download: {str(e)}")
|
||||||
return
|
|
||||||
else:
|
else:
|
||||||
print(f"Invalid installer file or version: {installer_file}")
|
raise InstallerNotFoundException(f"Invalid installer file or version: {installer_file}")
|
||||||
return
|
|
||||||
|
|
||||||
# Rest of the code remains the same...
|
# Rest of the code remains the same...
|
||||||
patch = make_patch(installer_file,
|
patch = make_patch(installer_file,
|
||||||
|
Loading…
Reference in New Issue
Block a user