I have some code where a user can remove items from a repeater. When each item is removed I refresh the dataset to refresh the display. When the last item gets removed, the refresh operation gives an error message. There is no way to catch that error message in the code.
async function librarianDataUpdate () {
$w ( ‘#requestsDS’ ). refresh ()
. then (( status) => {
console . log ( 'librarianDataUpdate refresh #requestsDS status: ’ , status );
})
. catch (( err) => {
console . log ( 'librarianDataUpdate refresh #requestsDS error: ’ , err );
});
let count = await openRequestCount ();
console . log ( ‘librarianDataUpdate: requestDS count =’ , count );
}
The output I get looks like this. Looks like it never enters the .catch block.
librarianDataUpdate refresh #requestsDS status: undefined app.js:25:18323
librarianDataUpdate: requestDS count = 2 app.js:25:18323
librarianDataUpdate: requestDS count = 1 app.js:25:18323
librarianDataUpdate refresh #requestsDS status: undefined app.js:25:18323
An error occurred in one of currentIndexChanged callbacks
Object { code: “DS_OPERATION_FAILED” }
code: “DS_OPERATION_FAILED”
: Object { … } app.js:6:14082
librarianDataUpdate refresh #requestsDS status: undefined app.js:25:18323
librarianDataUpdate: requestDS count = 0 app.js:25:18323