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

Improve error logging in the API (#1121)

parent 610c42a1
No related branches found
No related tags found
No related merge requests found
......@@ -176,6 +176,9 @@ handlers['api/download-budget'] = async function ({ syncId, password }) {
}
} else {
let files = await handlers['get-remote-files']();
if (!files) {
throw new Error('Could not get remote files');
}
let file = files.find(f => f.groupId === syncId);
if (!file) {
throw new Error(
......
......@@ -348,11 +348,12 @@ export async function listRemoteFiles() {
},
});
} catch (e) {
console.log('Error', e);
console.log('Unexpected error fetching file list from server', e);
return null;
}
if (res.status === 'error') {
console.log('Error fetching file list from server', res);
return null;
}
......
---
category: Enhancements
authors: [j-f1]
---
Improve error reporting when using the API
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