Skip to content

Commit

Permalink
fix documentation
Browse files Browse the repository at this point in the history
Co-authored-by: Žiga Vehovec <ziga.vehovec@bitmovin.com>
  • Loading branch information
krocard and zigavehovec authored Dec 7, 2023
1 parent 7fa8a85 commit 2b553af
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,14 @@ abstract class BitmovinBaseModule(
value class TPromise<T>(val promise: Promise) {
/**
* Resolve the promise with [value], see [Promise.resolve].
*
* Prefer [resolveOnCurrentThread] to automatically reject promise if an Exception is thrown.
*/
// Promise only support built-in types. Functions that return [Unit] must resolve to `null`.
fun resolve(value: T): Unit = promise.resolve(value.takeUnless { it is Unit })

/**
* Reject the promise due to [throwable], see [Promise.reject].
* Prefer [resolveOnCurrentThread] or [runAndRejectOnException] instead for automatic catching.
* Prefer [resolveOnCurrentThread] or [runAndRejectOnException] instead for automatic rejecting.
*/
fun reject(throwable: Throwable) {
Log.e(MODULE_NAME, "Failed to execute Bitmovin method", throwable)
Expand Down

0 comments on commit 2b553af

Please sign in to comment.