Skip to content

Instantly share code, notes, and snippets.

@akiradeveloper
Created August 28, 2015 01:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akiradeveloper/33ec0f6777c4dae78868 to your computer and use it in GitHub Desktop.
Save akiradeveloper/33ec0f6777c4dae78868 to your computer and use it in GitHub Desktop.
directives実験
case class Hoge(n: Int) {
def run: Route = {
complete(StatusCodes.OK)
}
}
def hoge: Route = {
pass {
Hoge(1).run
// complete(StatusCodes.OK)
}
}
def hige: Directive0 = {
mapInnerRoute { route => ctx =>
try {
route(ctx)
} catch {
case S3Error(e) => complete(ErrorMap.errorMap(e)._1)
}
}
}
val r = hige { hoge }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment