11package com .bugsnag ;
22
3- import com .bugsnag .callbacks .Callback ;
3+ import com .bugsnag .callbacks .OnErrorCallback ;
44import com .bugsnag .delivery .Delivery ;
55import com .bugsnag .delivery .HttpDelivery ;
66import com .bugsnag .util .DaemonThreadFactory ;
@@ -142,10 +142,10 @@ public void run() {
142142 * sent to Bugsnag completely.
143143 *
144144 * @param callback a callback to run before sending errors to Bugsnag
145- * @see Callback
145+ * @see OnErrorCallback
146146 */
147- public void addCallback ( Callback callback ) {
148- config .addCallback (callback );
147+ public void addOnError ( OnErrorCallback callback ) {
148+ config .addOnError (callback );
149149 }
150150
151151 /**
@@ -370,10 +370,10 @@ public boolean notify(Throwable throwable) {
370370 * Notify Bugsnag of a handled exception.
371371 *
372372 * @param throwable the exception to send to Bugsnag
373- * @param callback the {@link Callback } object to run for this Report
373+ * @param callback the {@link OnErrorCallback } object to run for this Report
374374 * @return true unless the error report was ignored
375375 */
376- public boolean notify (Throwable throwable , Callback callback ) {
376+ public boolean notify (Throwable throwable , OnErrorCallback callback ) {
377377 return notify (buildReport (throwable ), callback );
378378 }
379379
@@ -395,10 +395,10 @@ public boolean notify(Throwable throwable, Severity severity) {
395395 * @param throwable the exception to send to Bugsnag
396396 * @param severity the severity of the error, one of {#link Severity#ERROR},
397397 * {@link Severity#WARNING} or {@link Severity#INFO}
398- * @param callback the {@link Callback } object to run for this Report
398+ * @param callback the {@link OnErrorCallback } object to run for this Report
399399 * @return true unless the error report was ignored
400400 */
401- public boolean notify (Throwable throwable , Severity severity , Callback callback ) {
401+ public boolean notify (Throwable throwable , Severity severity , OnErrorCallback callback ) {
402402 if (throwable == null ) {
403403 LOGGER .warn ("Tried to notify with a null Throwable" );
404404 return false ;
@@ -436,12 +436,12 @@ boolean notify(Throwable throwable, HandledState handledState, java.lang.Thread
436436 * for this particular error report.
437437 *
438438 * @param event the {@link BugsnagEvent} object to send to Bugsnag
439- * @param reportCallback the {@link Callback } object to run for this Report
439+ * @param reportCallback the {@link OnErrorCallback } object to run for this Report
440440 * @return false if the error report was ignored
441441 * @see BugsnagEvent
442442 * @see #buildReport
443443 */
444- public boolean notify (BugsnagEvent event , Callback reportCallback ) {
444+ public boolean notify (BugsnagEvent event , OnErrorCallback reportCallback ) {
445445 if (event == null ) {
446446 LOGGER .warn ("Tried to call notify with a null Report" );
447447 return false ;
@@ -462,10 +462,10 @@ public boolean notify(BugsnagEvent event, Callback reportCallback) {
462462 }
463463
464464 // Run all client-wide onError callbacks
465- for (Callback callback : config .callbacks ) {
465+ for (OnErrorCallback callback : config .callbacks ) {
466466 try {
467467 boolean proceed = callback .onError (event );
468- if (!proceed || event . getShouldCancel () ) {
468+ if (!proceed ) {
469469 LOGGER .debug ("Error not reported to Bugsnag - cancelled by a client-wide onError callback" );
470470 return false ;
471471 }
@@ -481,7 +481,7 @@ public boolean notify(BugsnagEvent event, Callback reportCallback) {
481481 if (reportCallback != null ) {
482482 try {
483483 boolean proceed = reportCallback .onError (event );
484- if (!proceed || event . getShouldCancel () ) {
484+ if (!proceed ) {
485485 LOGGER .debug ("Error not reported to Bugsnag - cancelled by a report-specific callback" );
486486 return false ;
487487 }
0 commit comments