Commit b710f21a by Ryan McKinley Committed by GitHub

Toolkit: catch errors from signing service (#23486)

parent 2da704be
...@@ -77,6 +77,8 @@ const manifestRunner: TaskRunner<ManifestOptions> = async ({ folder }) => { ...@@ -77,6 +77,8 @@ const manifestRunner: TaskRunner<ManifestOptions> = async ({ folder }) => {
console.log('Request Signature:', url); console.log('Request Signature:', url);
const axios = require('axios'); const axios = require('axios');
try {
const info = await axios.post(url, manifest, { const info = await axios.post(url, manifest, {
headers: { Authorization: 'Bearer ' + GRAFANA_API_KEY }, headers: { Authorization: 'Bearer ' + GRAFANA_API_KEY },
responseType: 'arraybuffer', responseType: 'arraybuffer',
...@@ -90,6 +92,9 @@ const manifestRunner: TaskRunner<ManifestOptions> = async ({ folder }) => { ...@@ -90,6 +92,9 @@ const manifestRunner: TaskRunner<ManifestOptions> = async ({ folder }) => {
console.log('Saving the unsigned manifest'); console.log('Saving the unsigned manifest');
fs.writeFileSync(outputPath, JSON.stringify(manifest, null, 2)); 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); export const manifestTask = new Task<ManifestOptions>('Build Manifest', manifestRunner);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment