Skip to content

Commit 632d6eb

Browse files
committed
fix: use custom exception instead of AssertionError for curl errors
Avoids compile time deprecation warning: 'Warning: See corresponding Defect; AssertionError is deprecated' Signed-off-by: Christopher Arndt <[email protected]>
1 parent 16b2424 commit 632d6eb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/choosenimpkg/download.nim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,11 @@ proc addGithubAuthentication(url: string): string =
9797
return url.replace("https://api.github.com", "https://" & ghtoken & "@api.github.com")
9898

9999
when defined(curl):
100+
type CurlError* = object of CatchableError
101+
100102
proc checkCurl(code: Code) =
101103
if code != E_OK:
102-
raise newException(AssertionError, "CURL failed: " & $easy_strerror(code))
104+
raise newException(CurlError, "CURL failed: " & $easy_strerror(code))
103105

104106
proc downloadFileCurl(url, outputPath: string) =
105107
displayDebug("Downloading using Curl")

0 commit comments

Comments
 (0)