I’ve been working on my form validation. I see the dataset has the onError callback. Looking at the api - I added this code into my onReady function:
$w("#dataset1").onError((operation, error) => {
let errorOp = operation; // "save"
let errorCode = error.code; // "DS_VALIDATION_ERROR"
let errorMessage = error.message;
console.log("form error: ", errorOp, ", ", errorCode, ", ", errorMessage)
// DatasetError: Some of the elements validation failed
});
This works as expected - i.e. when I know a field is wrong, it prints something to the console.
My question: The message sucks. How do I figure out what exactly the problem is?
Here’s my output:
form error: save , DS_VALIDATION_ERROR , Some of the elements validation failed
Thank you!