Skip to content

Commit b09d734

Browse files
committed
增加异常处理
1 parent 29a93f6 commit b09d734

File tree

1 file changed

+11
-1
lines changed
  • AndroidExecLibrary/src/main/java/com/excellence/exec

1 file changed

+11
-1
lines changed

AndroidExecLibrary/src/main/java/com/excellence/exec/Command.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,17 @@ public void subscribe(ObservableEmitter<String> emitter) throws Exception {
215215
mIListener.onSuccess(result.toString());
216216
}
217217
}
218-
}).subscribeOn(Schedulers.io()).subscribe();
218+
}).subscribeOn(Schedulers.io()).subscribe(new Consumer<String>() {
219+
@Override
220+
public void accept(String s) throws Exception {
221+
222+
}
223+
}, new Consumer<Throwable>() {
224+
@Override
225+
public void accept(Throwable throwable) throws Exception {
226+
mIListener.onError(throwable);
227+
}
228+
});
219229
} catch (Exception e) {
220230
mIListener.onError(e);
221231
}

0 commit comments

Comments
 (0)