Improve rpc error handling

This commit is contained in:
Igor Kulikov 2020-06-08 10:29:42 +03:00
parent 168a941bb3
commit dc3c65dca2

View File

@ -670,6 +670,8 @@ export class WidgetSubscription implements IWidgetSubscription {
if (!this.executingRpcRequest || rejection.status === 408) { if (!this.executingRpcRequest || rejection.status === 408) {
this.rpcRejection = rejection; this.rpcRejection = rejection;
if (rejection.status === 408) { if (rejection.status === 408) {
this.rpcErrorText = 'Request Timeout.';
} else if (rejection.status === 409) {
this.rpcErrorText = 'Device is offline.'; this.rpcErrorText = 'Device is offline.';
} else { } else {
this.rpcErrorText = 'Error : ' + rejection.status + ' - ' + rejection.statusText; this.rpcErrorText = 'Error : ' + rejection.status + ' - ' + rejection.statusText;