Message

reactivemongo.api.commands.CommandException$.Message$
object Message

Pattern matching extractor for the error message.

import reactivemongo.core.errors.DatabaseException
import reactivemongo.api.commands.{ CommandException, WriteResult }

def testError(err: DatabaseException): String = err match {
 case CommandException.Message(msg) => s"hasMessage: \$msg"
 case _ => "no-message"
}

def testWriteRes(res: WriteResult): String = res match {
 case CommandException.Message(msg) => s"onlyIfFailure: \$msg"
 case _ => "no-message"
}

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Message.type

Members list

Concise view

Value members

Concrete methods

def unapply(scrutinee: Any): Option[String]