diff --git a/docs/_posts/2018-12-20-frame-processing.md b/docs/_posts/2018-12-20-frame-processing.md index 864f441e..1f1e463b 100644 --- a/docs/_posts/2018-12-20-frame-processing.md +++ b/docs/_posts/2018-12-20-frame-processing.md @@ -57,7 +57,13 @@ public void process(@NonNull Frame frame) { // EXAMPLE 1: // Firebase and Google APIs will often return a Task. // You can use Tasks.await() to complete the task on the current thread. - Tasks.await(firebaseDetector.detectInImage(firebaseImage)); + // Read: https://developers.google.com/android/guides/tasks#blocking + try { + result = Tasks.await(firebaseDetector.detectInImage(firebaseImage)); + catch (Exception e) { + // Firebase task failed. + } + // EXAMPLE 2: // For other async consumers, you can use, for example, a CountDownLatch.