Package

com.twosixlabs.dart

exceptions

Permalink

package exceptions

Visibility
  1. Public
  2. All

Type Members

  1. class AuthenticationException extends Exception with BadRequestException

    Permalink
  2. class AuthorizationException extends Exception with DartException

    Permalink
  3. class BadQueryParameterException extends Exception with BadRequestException

    Permalink
  4. class BadRequestBodyException extends Exception with BadRequestException

    Permalink
  5. trait BadRequestException extends DartRestException

    Permalink
  6. class CdrPersistenceException extends Exception with DartException

    Permalink
  7. trait DartException extends AnyRef

    Permalink
  8. trait DartRestException extends DartException

    Permalink

    DartRestExceptions should be used to pass messages to DartScalatraServlet.handleOutput, which will produce an appropriate http message.

    DartRestExceptions should be used to pass messages to DartScalatraServlet.handleOutput, which will produce an appropriate http message. Using these exceptions will remove the need for complex flow control to handle the multitude of cases that should be handled by a REST action, and will allow you to design your action around successful cases.

  9. class GenericServerException extends Exception with DartRestException

    Permalink

    This exception should be used for failures that do not correspond to any status codes more specific than 500 but still ought to pass some details to the user.

    This exception should be used for failures that do not correspond to any status codes more specific than 500 but still ought to pass some details to the user. All other exceptions should simply be passed to DartScalatraServlet without being translated to a DartRestException, which will result in a 500 response and an "Internal Server Error" message.

    If you throw this after catching another exception, you can pass that exception as 'cause' and DartScalatraServlet will log it for you.

  10. class InconsistentCdrDataException extends Exception with DartException

    Permalink
  11. class MalformedCdrException extends Exception with DartException

    Permalink
  12. class MissingCdrException extends Exception with DartException

    Permalink
  13. class ResourceNotFoundException extends Exception with DartRestException

    Permalink
  14. class ServiceUnreachableException extends Exception with DartRestException

    Permalink

Value Members

  1. object ExceptionImplicits

    Permalink

    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.

    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()

  2. object Exceptions

    Permalink

Ungrouped