Exceptions
PHP Manual

The MongoCursorException class

Introduction

Caused by accessing a cursor incorrectly or a error receiving a reply.

If there is an error receiving a reply, there will be a more specific error message to help diagnose the problem. As it is a bit programmatically awkward to parse an exception message, there is also an error code associated with each cause of the exception.

  • threw away response, please try again

    Code: 1

    Unlikely to occur in a single-threaded application. The database sent the resoponse while another thread was waiting for a response, so the other thread threw it out. You should attempt the query again, possibly with less threads.

  • various

    Code: 1

    A database reply could not be recieved because a connection with the database could not be established.

  • various

    Code: 2

    Caused by the request timing out. This will return the error message from the C socket library.

  • no db response

    Code: 4

    This may not even be an error, for example, the database command "shutdown" returns no response. However, if you were expecting a response, this means the database didn't give one.

  • bad response length: %d, max: %d, did the db assert?

    This means that the database said that its response was greater than 4Mb or less than 0. Generally, a number greater than 5Mb should be reported to the developers as a potential database bug (max response length is 4Mb). A response of less than 0 often means a database assertion occured.

  • incomplete response

    Highly unusual. Occurs if the database response started out correctly, but broke off in the middle.

  • error getting database response: errstr

    WSA error getting database response: errstr

    "errstr" is an io error reported directly from the C socket subsystem. On Windows, the error message is prefixed with "WSA".

Class synopsis

MongoCursorException
extends MongoException {
}

Exceptions
PHP Manual