Change code to throw Error
This commit is contained in:
parent
e57181684f
commit
37fc409321
@ -5,5 +5,5 @@ export async function url_get (url : string, options? : OptionsOfTextResponseBod
|
|||||||
if(response.statusCode === 200) {
|
if(response.statusCode === 200) {
|
||||||
return response.body
|
return response.body
|
||||||
}
|
}
|
||||||
else throw `Got ${response.statusCode} from ${url}`
|
else throw new Error(`Got ${response.statusCode} from ${url}`)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user