Get response message from netwrok/server

Hi guys, I have a such method:

importDeviceTmpl(connectionId, deviceId, prefSuff).then(results => {
     webix.$$("devicePopup").close();
     this.reload();
 });

I want to get response message from network, the response message includes some errors to show to users. The “results” does not include the message.
My function in backend sends the response message, I can see it in network messages in Chrome. How can get the message?
For example, here, I used it in upload method and it worked.

onUploadComplete: (response) => {
   if (!response.success) {
      this.showError("error", response.message);
    } else {
         this.showError("info", response.message);
         this.reloadDevices();
    }
}

@Yryskul: You can format code blocks by surrounding them with lines consisting of triple backticks.

@Webix team: can you guys configure Vanilla to add a “Formatting help” link or similar to the posting UI? Hopefully that will help people take advantage of the formatting capabilities of the forum.

@Yryskul

You need to send the response like {“status”: “server”} for success and {“status”: “error”} for error, otherwise you won’t able to call even onUploadComplete event
https://snippet.webix.com/rmeltpfv

@Meera
onUploadComplete is working perfectly, however, how can I get the response I sent from backend in my method like above importDeviceTmpl(…). I included to message in backend the property “message.put(“status”, “error”);”

Thanks, I solved. The included code:

if (!results.json().status) {
    this.showError("error", results.json().message)
}