Skip to content

Commit 93e3ea0

Browse files
author
John McCambridge
committed
fix error in promise
1 parent 61e5ea3 commit 93e3ea0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/server/src/updater.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const compareVersions = (a: string, b: string): number | undefined => {
2121
};
2222

2323
export const getRecentRelease = (): Promise<any> => {
24-
return new Promise<string>((resolve):void => {
24+
return new Promise<string>((resolve, rej):void => {
2525
const options = {
2626
host: "api.github.com",
2727
path: "/repos/codercom/code-server/releases/latest",
@@ -34,7 +34,7 @@ export const getRecentRelease = (): Promise<any> => {
3434

3535
https.get(options, (res) => {
3636
if (res.statusCode !== 200) {
37-
throw new Error("Failed to acquire release information");
37+
rej(Error("Failed to acquire release information"));
3838
}
3939
let body = "";
4040
res.on("data", (chunk) => {

0 commit comments

Comments
 (0)