We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0531b8b commit 87e308aCopy full SHA for 87e308a
rxjava-core/src/main/java/rx/util/Exceptions.java
@@ -21,8 +21,18 @@ private Exceptions() {
21
}
22
23
public static RuntimeException propagate(Throwable t) {
24
+ /**
25
+ * The return type of RuntimeException is a trick for code to be like this:
26
+ *
27
+ * throw Exceptions.propagate(e);
28
29
+ * Even though nothing will return and throw via that 'throw', it allows the code to look like it
30
+ * so it's easy to read and understand that it will always result in a throw.
31
+ */
32
if (t instanceof RuntimeException) {
33
throw (RuntimeException) t;
34
+ } else if (t instanceof Error) {
35
+ throw (Error) t;
36
} else {
37
throw new RuntimeException(t);
38
0 commit comments