File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -226,7 +226,7 @@ export class LanguageServerResolver {
226226 res : await new HttpResourceFetcher ( content . url , {
227227 showUrl : true ,
228228 timeout : timeout ,
229- swallowError : false ,
229+ throwOnError : true ,
230230 } ) . get ( ) ,
231231 hash : content . hashes [ 0 ] ,
232232 filename : content . filename ,
Original file line number Diff line number Diff line change @@ -22,18 +22,18 @@ export class HttpResourceFetcher implements ResourceFetcher<Response> {
2222 * @param {string } params.friendlyName If URL is not shown, replaces the URL with this text.
2323 * @param {Timeout } params.timeout Timeout token to abort/cancel the request. Similar to `AbortSignal`.
2424 * @param {number } params.retries The number of retries a get request should make if one fails
25- * @param {boolean } params.swallowError True if we want to swallow the request error, false if we want the error to keep bubbling up
25+ * @param {boolean } params.throwOnError True if we want to throw if there's request error, defaul to false
2626 */
2727 public constructor (
2828 private readonly url : string ,
2929 private readonly params : {
3030 showUrl : boolean
3131 friendlyName ?: string
3232 timeout ?: Timeout
33- swallowError ?: boolean
33+ throwOnError ?: boolean
3434 }
3535 ) {
36- this . params . swallowError = this . params . swallowError ?? true
36+ this . params . throwOnError = this . params . throwOnError ?? false
3737 }
3838
3939 /**
@@ -86,10 +86,10 @@ export class HttpResourceFetcher implements ResourceFetcher<Response> {
8686 `Error downloading ${ this . logText ( ) } : %s` ,
8787 error . message ?? error . code ?? error . response . statusText ?? error . response . status
8888 )
89- if ( this . params . swallowError ) {
90- return undefined
89+ if ( this . params . throwOnError ) {
90+ throw error
9191 }
92- throw error
92+ return undefined
9393 }
9494 }
9595
You can’t perform that action at this time.
0 commit comments