Object

com.twosixlabs.dart.exceptions

ExceptionImplicits

Related Doc: package exceptions

Permalink

object ExceptionImplicits

A set of implicit conversions providing methods for exceptions and exception-handling classes (e.g., Future, Try, CompletableFuture) that allow performing side-effects (i.e., logging) on the exceptions and exception message. Each method returns the object they are called on, so they are useful for logging without interrupting method chaining.

Basic usages:

import com.twosixlabs.dart.exceptions.ExceptionImplicits._

1) val future = dbClient.queryReturningFuture( query ).logged 2) val completableFuture = javaClient.queryReturningCompletableFuture( query ).logged 3) val try = dbClient.queryReturningTry( query ).logged 4) val result : Option[ Int ] = queryResponse match { case Success( value ) => Some( value ) case Failure( e ) => e.log }

Log level is error, to change log level use .loggedInfo, .loggedWarning, or .loggedDebug Stack traces can be logged with your own logger using .withErrorString( LOG.info ), and custom error handling can be achieved using .withError() instead of .withErrorString()

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ExceptionImplicits
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. implicit class CompletableFutureExceptionLogging[T] extends AnyRef

    Permalink
  2. implicit class FutureExceptionLogging[T] extends AnyRef

    Permalink
  3. implicit class ThrowableLogging extends AnyRef

    Permalink
  4. implicit class TryExceptionLogging[T] extends AnyRef

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. val LOG: Logger

    Permalink
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  11. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  12. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  14. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  15. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  16. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  17. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  18. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped