Toolkit: catch errors from signing service (#23486)

This commit is contained in:
Ryan McKinley 2020-04-09 13:30:34 -07:00 committed by GitHub
parent 2da704be55
commit b710f21a06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,6 +77,8 @@ const manifestRunner: TaskRunner<ManifestOptions> = async ({ folder }) => {
console.log('Request Signature:', url);
const axios = require('axios');
try {
const info = await axios.post(url, manifest, {
headers: { Authorization: 'Bearer ' + GRAFANA_API_KEY },
responseType: 'arraybuffer',
@ -90,6 +92,9 @@ const manifestRunner: TaskRunner<ManifestOptions> = async ({ folder }) => {
console.log('Saving the unsigned manifest');
fs.writeFileSync(outputPath, JSON.stringify(manifest, null, 2));
}
} catch (err) {
console.log('ERROR Fetching response', err);
}
};
export const manifestTask = new Task<ManifestOptions>('Build Manifest', manifestRunner);