Skip to content
Snippets Groups Projects
Unverified Commit 9c527e3f authored by Jed Fox's avatar Jed Fox Committed by GitHub
Browse files

Improve messaging when the API fails to download a file (#1396)

parent b8c90aa8
No related branches found
No related tags found
No related merge requests found
......@@ -204,6 +204,7 @@ handlers['api/download-budget'] = async function ({ syncId, password }) {
let result = await handlers['download-budget']({ fileId: file.fileId });
if (result.error) {
console.log('Full error details', result.error);
throw new Error(getDownloadError(result.error));
}
await handlers['load-budget']({ id: result.id });
......
......@@ -51,10 +51,11 @@ export function getDownloadError({ reason, meta, fileName }) {
);
default:
let info = meta && meta.fileId ? `(fileId: ${meta.fileId})` : '';
let info = meta && meta.fileId ? `, fileId: ${meta.fileId}` : '';
return (
'Something went wrong trying to download that file, sorry! Visit https://actualbudget.org/contact/ for support. ' +
info
'Something went wrong trying to download that file, sorry! ' +
'Visit https://actualbudget.org/contact/ for support. ' +
`(reason: ${reason}${info})`
);
}
}
......
---
category: Enhancements
authors: [j-f1]
---
Improve error messaging when the API package fails to download a file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment