cancel
Showing results for 
Search instead for 
Did you mean: 

Target property is undefined in Error Object

04-02-2024 11:30 AM
Raphael Explorer
434 views 0 comments
SAP Managed Tags
Labels
CAPCDSJavaScriptODatav4
Subscribe

Inside of a handler for a custom action I create this error.

req.error(409, "NEW_STOCK_ERROR", "newStock");

When I catch the error in javascript the target property of the error object is undefined.

try {
  await request.execute();
catch ({ error }) {
  this._handleErrors(error);
  return;
}

Raphael_0-1712049772221.png

When I check the network tab I can see that the target is being sent back to the client.

Raphael_1-1712049856399.png

Is this a problem with Javascript in general or UI5 specifically?

Any help is appreciated.

Accepted Solutions (0)

Answers (0)