Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphael Levin committed May 6, 2024
1 parent 1381daf commit f3b596c
Showing 1 changed file with 24 additions and 28 deletions.
52 changes: 24 additions & 28 deletions src/fetcher/fetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,37 +85,33 @@ export class Fetcher {
url = filter(url);
});

try {
emitter('VAST-resolving', {
url,
previousUrl,
wrapperDepth,
maxWrapperDepth,
timeout: this.fetchingOptions.timeout,
wrapperAd,
});
emitter('VAST-resolving', {
url,
previousUrl,
wrapperDepth,
maxWrapperDepth,
timeout: this.fetchingOptions.timeout,
wrapperAd,
});

const data = await this.urlHandler.get(url, this.fetchingOptions);
const requestDuration = Math.round(Date.now() - timeBeforeGet);
const data = await this.urlHandler.get(url, this.fetchingOptions);
const requestDuration = Math.round(Date.now() - timeBeforeGet);

emitter('VAST-resolved', {
url,
previousUrl,
wrapperDepth,
error: data?.error || null,
duration: requestDuration,
statusCode: data?.statusCode || null,
...data?.details,
});
updateEstimatedBitrate(data?.details?.byteLength, requestDuration);
emitter('VAST-resolved', {
url,
previousUrl,
wrapperDepth,
error: data?.error || null,
duration: requestDuration,
statusCode: data?.statusCode || null,
...data?.details,
});
updateEstimatedBitrate(data?.details?.byteLength, requestDuration);

if (data.error) {
throw new Error(data.error);
} else {
return data.xml;
}
} catch (error) {
throw error;
if (data.error) {
throw new Error(data.error);
} else {
return data.xml;
}
}
}

0 comments on commit f3b596c

Please sign in to comment.