mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-12 11:08:31 -05:00
Merge from vscode 2e5312cd61ff99c570299ecc122c52584265eda2
This commit is contained in:
committed by
Anthony Dresser
parent
3603f55d97
commit
7f1d8fc32f
@@ -48,7 +48,13 @@ export async function asJson<T = {}>(context: IRequestContext): Promise<T | null
|
||||
return null;
|
||||
}
|
||||
const buffer = await streamToBuffer(context.stream);
|
||||
return JSON.parse(buffer.toString());
|
||||
const str = buffer.toString();
|
||||
try {
|
||||
return JSON.parse(str);
|
||||
} catch (err) {
|
||||
err.message += ':\n' + str;
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user