mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Better Smoke test setup (#11005)
* add handling for 404 * make the error message make more sense
This commit is contained in:
@@ -82,11 +82,13 @@ function getVersion(remote: boolean) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function fetch(url: string): Promise<Buffer | undefined> {
|
function fetch(url: string): Promise<Buffer | undefined> {
|
||||||
return new Promise<Buffer>((resolve, reject) => {
|
return new Promise<Buffer | undefined>((resolve, reject) => {
|
||||||
const buffers: Buffer[] = [];
|
const buffers: Buffer[] = [];
|
||||||
const req = request(url, async res => {
|
const req = request(url, res => {
|
||||||
if (res.headers.location) {
|
if (res.headers.location) {
|
||||||
resolve(await fetch(res.headers.location));
|
resolve(fetch(res.headers.location));
|
||||||
|
} else if (res.statusCode === 404) {
|
||||||
|
reject(`${url}: ${res.statusMessage}`);
|
||||||
} else {
|
} else {
|
||||||
res.on('data', chunk => buffers.push(chunk));
|
res.on('data', chunk => buffers.push(chunk));
|
||||||
res.on('end', () => {
|
res.on('end', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user