Exception: Mongo::Auth::Unauthorized

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/mongo/auth.rb

Overview

Raised when a user is not authorized on a database.

Since:

  • 2.0.0

Instance Method Summary collapse

Constructor Details

#initialize(user) ⇒ Unauthorized

Instantiate the new error.

Examples:

Instantiate the error.

Mongo::Auth::Unauthorized.new(user)

Parameters:

Since:

  • 2.0.0



102
103
104
# File 'lib/mongo/auth.rb', line 102

def initialize(user)
  super("User #{user.name} is not authorized to access #{user.database}.")
end