com.todoroo.andlib.service
Class ExceptionService

java.lang.Object
  extended by com.todoroo.andlib.service.ExceptionService

public class ExceptionService
extends java.lang.Object

Exception handling utility class - reports and logs errors

Author:
Tim Su

Nested Class Summary
static class ExceptionService.AndroidLogReporter
          AndroidLogReporter reports errors to LogCat
static interface ExceptionService.ErrorReporter
          Error reporter interface
static class ExceptionService.TodorooUncaughtExceptionHandler
          Uncaught exception handler uses the exception utilities class to report errors
 
Field Summary
 ExceptionService.ErrorReporter[] errorReporters
           
 
Constructor Summary
ExceptionService()
           
 
Method Summary
 void displayAndReportError(android.content.Context context, java.lang.String name, java.lang.Throwable error)
          Display error dialog if context is activity and report error
 void reportError(java.lang.String name, java.lang.Throwable error)
          Report the error via registered error handlers
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

errorReporters

public ExceptionService.ErrorReporter[] errorReporters
Constructor Detail

ExceptionService

public ExceptionService()
Method Detail

reportError

public void reportError(java.lang.String name,
                        java.lang.Throwable error)
Report the error via registered error handlers

Parameters:
name - Internal error name. Not displayed to user
error - Exception encountered. Message will be displayed to user

displayAndReportError

public void displayAndReportError(android.content.Context context,
                                  java.lang.String name,
                                  java.lang.Throwable error)
Display error dialog if context is activity and report error

Parameters:
context - Application Context
name - Internal error name. Not displayed to user
error - Exception encountered. Message will be displayed to user