|
@@ -82,7 +82,7 @@ async function doRequest(path, options) {
|
|
};
|
|
};
|
|
const qs = options.query ? `?${new URLSearchParams(options.query)}` : '';
|
|
const qs = options.query ? `?${new URLSearchParams(options.query)}` : '';
|
|
if (options.body) {
|
|
if (options.body) {
|
|
- init.headers['content-type'] = 'application/vnd.api+json';
|
|
|
|
|
|
+ init.headers['content-type'] ||= 'application/vnd.api+json';
|
|
init.body = JSON.stringify(options.body);
|
|
init.body = JSON.stringify(options.body);
|
|
}
|
|
}
|
|
if (!path.includes('://')) path = `https://rest.api.transifex.com${path}`;
|
|
if (!path.includes('://')) path = `https://rest.api.transifex.com${path}`;
|
|
@@ -291,7 +291,7 @@ async function batchHandle(handle, allowedLangs) {
|
|
finished += 1;
|
|
finished += 1;
|
|
showProgress();
|
|
showProgress();
|
|
} catch (err) {
|
|
} catch (err) {
|
|
- process.stderr.write(`\nError pulling ${lang}\n`);
|
|
|
|
|
|
+ process.stderr.write(`\nError handling ${lang}\n`);
|
|
throw err;
|
|
throw err;
|
|
}
|
|
}
|
|
}));
|
|
}));
|