Custom rest error on JS

I’ve create a custome rest exception for cuba, and I want to use those messages from my ionic app, this app is using @cuba-platform/rest 2.1.0 to make the calls to the api, but the errors I am getting, its always the same:


The custome rest exception its working fine becasue the errors can be displeyed using postman, so i guess the problem is the libriry for node. There is a way to do that?, or I am doing a mistake?.

I found the solution. The error is a CubaRestError, and taking the response from there you can get the message.

.catch(async (error: CubaRestError)=>{
        await error.response.json().then((customeError: CubaCustomeRestError)=>{
          throw customeError;
        });
      });

With CubaCustomeRestError as a interface with your custom element, in my case error and details.