Added catch for HTTPError and added papermc ground work

Changes:
- Added HTTPError catch when searching for a plugin
- Created first ground work for papermc server jar support
This commit is contained in:
Neocky
2021-03-15 01:20:18 +01:00
parent 932ae66827
commit 20261d110e
2 changed files with 40 additions and 2 deletions

View File

@@ -78,9 +78,15 @@ def searchPackage(ressourceName):
ressourceSelected = ressourceSelected - 1
ressourceId = packageName[ressourceSelected]["id"]
if not checkConfig().localPluginFolder:
getSpecificPackage(ressourceId, checkConfig().sftp_folderPath)
try:
getSpecificPackage(ressourceId, checkConfig().sftp_folderPath)
except HTTPError as err:
print(oColors.brightRed + f"Error: {err.code} - {err.reason}" + oColors.standardWhite)
else:
getSpecificPackage(ressourceId, checkConfig().pathToPluginFolder)
try:
getSpecificPackage(ressourceId, checkConfig().pathToPluginFolder)
except HTTPError as err:
print(oColors.brightRed + f"Error: {err.code} - {err.reason}" + oColors.standardWhite)
def downloadSpecificVersion(ressourceId, downloadPath, versionID='latest'):