capture exceptions thrown by the MongoDB driver

If a plan is constructed and submitted to the MongoDB driver, and then an error occurs inside the driver, you now can see all the debug logging etc., plus a line with the message from the driver's exception.

Also, added a REPL command to hide the detailed logging: `set debug = 0`. The idea is that level 2 will get you even more verbose logging when #50 is implemented.
Instead of a boolean logDetails flag, for example, you could pass a function from Details => Cord, which could be used to render or not render the details as necessary. Boolean flags are meaningless and should never be used. In fact booleans are always an anti-pattern except when used inside of conditionals or predicates. :-/


-- 
John A. De Goes
Follow me @jdegoes

On July 7, 2014 at 4:19:26 PM, Moss Prescott (notifications@github.com) wrote:

In src/main/scala/slamdata/engine/backend.scala:

> @@ -25,7 +25,7 @@ sealed trait Backend {
>     * Executes a query, placing the output in the specified resource, returning both
>     * a compilation log and a source of values from the result set.
>     */
> -  def eval(query: Query, out: Path): Task[(Cord, Process[Task, RenderedJson])] = {
> +  def eval(query: Query, out: Path, logDetails: Boolean): Task[(Cord, Process[Task, RenderedJson])] = {
Sure, but in this case I'm not sure what's a sensible approach. For now, I'll change it to produce two logs and just pick the right one to log. As you can see, it's not currently implemented anyway. That will be part of #50.

—
Reply to this email directly or view it on GitHub.