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.
Done and pushed.

On Jul 8, 2014, at 13:39, John A. De Goes <notifications@github.com> wrote:

> In src/main/scala/slamdata/engine/physical/mongodb/evaluator.scala:
> 
> > -        }),
> > -        // mr.selection.map(_.repr).getOrElse((new QueryBuilder).get)
> > -        (new QueryBuilder).get))
> > +    colS(source).flatMap { src =>
> > +      liftMongoException(
> > +        src.mapReduce(new MapReduceCommand(
> > +          src,
> > +          mr.map.render(0),
> > +          mr.reduce.render(0),
> > +          dst.collection.name,
> > +          (mr.out.map(_.action) match {
> > +            case Some(Action.Merge)  => MapReduceCommand.OutputType.MERGE
> > +            case Some(Action.Reduce) => MapReduceCommand.OutputType.REDUCE
> > +            case _                   => MapReduceCommand.OutputType.REPLACE
> > +          }),
> > +          // mr.selection.map(_.repr).getOrElse((new QueryBuilder).get)
> 
> Yeah please delete.
> 
> —
> Reply to this email directly or view it on GitHub.
>