How to terminate function execution on catch? I assume that return should be put where I put it (.catch( error => {console.log(error);} return)), but that doesn't work. Tell me how to do it right?
getCustomers: function () {
let url = '/crm/customer/';
axios.get(url).then((response) => {
this.customers = response.data.results;
if (this.customers.length === 100) {
for (let i = 2; i < 100; i++) {
axios.get('/crm/customer/?page=' + i).then((response) => {
this.c = response.data.results;
for (let item of this.c.values()) {
this.customers.push(item);
}
}).catch( global_waiting_stop());
}
}
}).catch( error => { console.log(error); })
.finally(() => (global_waiting_stop()));
},