Skip to content

Instantly share code, notes, and snippets.

@robhinds
Created December 18, 2017 16:27
Show Gist options
  • Save robhinds/cabe561a0fe49a7869a619cd4784f962 to your computer and use it in GitHub Desktop.
Save robhinds/cabe561a0fe49a7869a619cd4784f962 to your computer and use it in GitHub Desktop.
type Response[T] = Either[AkkOpError, T]
object Errors {
sealed trait AkkOpError {
val statusCode: Int
val data: String
}
case class NotFound(data: String, statusCode: Int = StatusCodes.NotFound.intValue) extends AkkOpError
case class BadRequest(data: String, statusCode: Int = StatusCodes.BadRequest.intValue) extends AkkOpError
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment