I have an observable function, that does request:
public send(): Observable<ISms[]> {
if (this.usedAttempts < this.maxAttempts) {
return; // Here return custom error
}
}
I take this observable like as:
this.sms.send().subscribe(
response => {
console.log(response);
},
error => {
console.log(error);
}
);
}
I need to check if user can send Sms if yes, send, otherwise return error.