I update my docs with the javascript api's updateByQuery using
const res = await this.elastic.update({
index: MY_INDEX,
type: MY_TYPE,
id: MY_ID,
_source: true,
body: {
script: {
source: `
// stuff
`,
},
};
}
How can I throw or set custom error messages such that when I read the response, I know why it failed?