Created
August 28, 2015 01:37
-
-
Save akiradeveloper/33ec0f6777c4dae78868 to your computer and use it in GitHub Desktop.
directives実験
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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