essential-slick
essential-slick copied to clipboard
Describe error handling
(Well, investigate first)
From nafg on gitterr:
DBIO has combinators for error handling, like toTry that turns a DBIO[A] into a DBIO[Try[A]] surfacing the error state
Or is it better to look at error handing in the Future[A] result?
What do I even mean by "error"?
Is this linked to #44?
Could be. I don't really know what I mean by error handling. I might be talking application errors, SQL errors, connection failure. It's not thought out. But it seems like it should be a topic. (NB: this is filed in "icebox" for some unspecified future date).
Related: named as a way to track down problems (we list named in a table in chapter 4)
You name an action by calling named on it. E.g.,
someAction.named(“get all the things”)Then in logback.xml turn up the debugging on slick.<logger name="slick.backend.DatabaseComponent.action" level="DEBUG”/>When the query runs the log should show something like:
DEBUG DatabaseComponent.action - #1: named get all the things
DEBUG DatabaseComponent.action - #2: StreamingInvokerAction$HeadAction [THE SQL THAT CAUSE THE PROBLEM HERE]
https://gitter.im/underscoreio/scala?at=570ca9fd8b17927458e39076