Code
reactivemongo.api.commands.CommandException$.Code$
object Code
Pattern matching extractor for the error code.
import reactivemongo.core.errors.DatabaseException
import reactivemongo.api.commands.{ CommandException, WriteResult }
def testError(err: DatabaseException): String = err match {
case CommandException.Code(code) => s"hasCode: \$code"
case _ => "no-code"
}
def testWriteRes(res: WriteResult): String = res match {
case CommandException.Code(code) => s"onlyIfFailure: \$code"
case _ => "no-code"
}
Attributes
- See also:
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Self type
- Code.type