Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit 93aa07e

Browse files
committed
fix: catch error
1 parent bd3e495 commit 93aa07e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/nix.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,15 @@ export function semver (version: string): string {
2828
return match ? sprintf('%05i.%05i.%05i%s', match[1], match[3] || 0, match[5] || 0, match[6] || '') : version
2929
}
3030
// Register function in the database
31-
db.function('semver', semver)
31+
try {
32+
db.function('semver', semver)
33+
} catch(error) {
34+
// The following error get's thown sometimes (maybe if the function
35+
// has already been registered?)
36+
if (error.message !== 'Expected first argument to be a string') {
37+
throw error
38+
}
39+
}
3240

3341
// Currently we're putting generate Nix profiles in the /nix directory.
3442
// This is somewhat arbitrary.

0 commit comments

Comments
 (0)