Change code to throw Error

This commit is contained in:
슈리튬 2021-09-04 20:38:39 +09:00 committed by GitHub
parent e57181684f
commit 37fc409321
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,5 +5,5 @@ export async function url_get (url : string, options? : OptionsOfTextResponseBod
if(response.statusCode === 200) {
return response.body
}
else throw `Got ${response.statusCode} from ${url}`
}
else throw new Error(`Got ${response.statusCode} from ${url}`)
}