-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve CurseForge package installer
- Loading branch information
1 parent
a9e8890
commit 81beaf9
Showing
4 changed files
with
103 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
ProjBobcat/ProjBobcat/Exceptions/CurseForgeModResolveException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System; | ||
|
||
namespace ProjBobcat.Exceptions; | ||
|
||
public class CurseForgeModResolveException : Exception | ||
{ | ||
readonly long _addonId, _fileId; | ||
readonly string? _moreInfo; | ||
|
||
public CurseForgeModResolveException(long addonId, long fileId) | ||
{ | ||
_addonId = addonId; | ||
_fileId = fileId; | ||
} | ||
|
||
public CurseForgeModResolveException(long addonId, long fileId, string moreInfo) | ||
{ | ||
_addonId = addonId; | ||
_fileId = fileId; | ||
_moreInfo = moreInfo; | ||
} | ||
|
||
public override string ToString() | ||
{ | ||
return $$""" | ||
|
||
无法解析一个或多个 CurseForge 模组,可能的原因是因为该模组已近被作者删除或是该整合包所需的该模组的文件已经被删除。 | ||
模组文件下载链接:https://api.curseforge.com/v1/mods/{{_addonId}}/files/{{_fileId}}/download-url | ||
{{_moreInfo}} | ||
"""; | ||
} | ||
} |