Repository navigation
Expand file tree
/
Copy pathRxJavaErrorHandler.java
More file actions
47 lines (43 loc) · 1.67 KB
/
Copy pathRxJavaErrorHandler.java
File metadata and controls
47 lines (43 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/**
* Copyright 2014 Netflix, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package rx.plugins;
import rx.Observable;
import rx.Subscriber;
/**
* Abstract class for defining error handling logic in addition to the normal
* {@link Subscriber#onError(Throwable)} behavior.
* <p>
* For example, all {@code Exception}s can be logged using this handler even if
* {@link Subscriber#onError(Throwable)} is ignored or not provided when an {@link Observable} is subscribed to.
* <p>
* See {@link RxJavaPlugins} or the RxJava GitHub Wiki for information on configuring plugins: <a
* href="https://github.com/ReactiveX/RxJava/wiki/Plugins">https://github.com/ReactiveX/RxJava/wiki/Plugins</a>.
*/
public abstract class RxJavaErrorHandler {
/**
* Receives all {@code Exception}s from an {@link Observable} passed to
* {@link Subscriber#onError(Throwable)}.
* <p>
* This should <em>never</em> throw an {@code Exception}. Make sure to try/catch({@code Throwable}) all code
* inside this method implementation.
*
* @param e
* the {@code Exception}
*/
public void handleError(Throwable e) {
// do nothing by default
}
}