chore(download): report unparseable response JSON
This commit is contained in:
parent
73fd547892
commit
40dcf09aaf
1 changed files with 7 additions and 1 deletions
|
@ -59,7 +59,13 @@ export default async function downloadBlobFromPointer(
|
|||
body: [Buffer.from(JSON.stringify(lfsInfoRequestData))],
|
||||
});
|
||||
|
||||
const lfsInfoResponseData = JSON.parse((await bodyToBuffer(lfsInfoBody)).toString());
|
||||
const lfsInfoResponseRaw = (await bodyToBuffer(lfsInfoBody)).toString();
|
||||
let lfsInfoResponseData: any;
|
||||
try {
|
||||
lfsInfoResponseData = JSON.parse(lfsInfoResponseRaw);
|
||||
} catch (e) {
|
||||
throw new Error(`Unexpected structure received from LFS server: unable to parse JSON ${lfsInfoResponseRaw}`);
|
||||
}
|
||||
|
||||
if (isValidLFSInfoResponseData(lfsInfoResponseData)) {
|
||||
|
||||
|
|
Loading…
Reference in a new issue