public class

MongoException

extends RuntimeException
java.lang.Object
   ↳ java.lang.Throwable
     ↳ java.lang.Exception
       ↳ java.lang.RuntimeException
         ↳ com.mongodb.MongoException
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

A general exception raised in Mongo

Summary

Nested Classes
class MongoException.CursorNotFound Subclass of MongoException representing a cursor-not-found exception  
class MongoException.DuplicateKey Subclass of MongoException representing a duplicate key exception  
class MongoException.Network Subclass of MongoException representing a network-related exception  
Public Constructors
MongoException(String msg)
MongoException(int code, String msg)
MongoException(String msg, Throwable t)
MongoException(int code, String msg, Throwable t)
MongoException(BSONObject o)
Creates a MongoException from a BSON object representing an error
Public Methods
int getCode()
Gets the exception code
[Expand]
Inherited Methods
From class java.lang.Throwable
From class java.lang.Object

Public Constructors

public MongoException (String msg)

Parameters
msg the message

public MongoException (int code, String msg)

Parameters
code the error code
msg the message

public MongoException (String msg, Throwable t)

Parameters
msg the message
t the throwable cause

public MongoException (int code, String msg, Throwable t)

Parameters
code the error code
msg the message
t the throwable cause

public MongoException (BSONObject o)

Creates a MongoException from a BSON object representing an error

Public Methods

public int getCode ()

Gets the exception code