Skip to content

Commit 69857d7

Browse files
committed
Rename {Callback,AsyncCallback}.{error ⇒ throwException}
1 parent 46eed18 commit 69857d7

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

core/src/main/scala/japgolly/scalajs/react/AsyncCallback.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ object AsyncCallback {
2828
def pure[A](a: A): AsyncCallback[A] =
2929
const(Success(a))
3030

31-
def error[A](t: Throwable): AsyncCallback[A] =
31+
def throwException[A](t: Throwable): AsyncCallback[A] =
3232
const(Failure(t))
3333

3434
def const[A](t: Try[A]): AsyncCallback[A] =

core/src/main/scala/japgolly/scalajs/react/Callback.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ object Callback {
4141
CallbackTo.pure(())
4242

4343
def error(t: Throwable): Callback =
44-
CallbackTo.error(t)
44+
CallbackTo.throwException(t)
4545

4646
/**
4747
* Callback that isn't created until the first time it is used, after which it is reused.
@@ -183,7 +183,7 @@ object CallbackTo {
183183
def pure[A](a: A): CallbackTo[A] =
184184
new CallbackTo(() => a)
185185

186-
def error[A](t: Throwable): CallbackTo[A] =
186+
def throwException[A](t: Throwable): CallbackTo[A] =
187187
CallbackTo(throw t)
188188

189189
/** Callback that isn't created until the first time it is used, after which it is reused. */

gh-pages/src/main/scala/ghpages/secret/tests/AsyncTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ object AsyncTest {
108108

109109
.add("jsPromise: from fixed ko")(testCmp {
110110
val e = new RuntimeException("AH")
111-
val p = AsyncCallback.error[Int](e).unsafeToJsPromise()
111+
val p = AsyncCallback.throwException[Int](e).unsafeToJsPromise()
112112
val t1,t2 = AsyncCallback.fromJsPromise(p).attempt
113113
t1.zip(t2) -> (Left(e), Left(e))
114114
})

0 commit comments

Comments
 (0)