Exception: Coarnotify::Server::COARNotifyServerError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/coarnotify/server.rb

Overview

An exception class for server errors in the COAR Notify server implementation.

The web layer of your server implementation should be able to intercept this from the COARNotifyServer#receive method and return the appropriate HTTP status code and message to the user in its standard way.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status, msg) ⇒ COARNotifyServerError

Construct a new COARNotifyServerError with the given status code and message

Parameters:

  • status (Integer)

    HTTP Status code to respond to the client with

  • msg (String)

    Message to send back to the client



60
61
62
63
64
# File 'lib/coarnotify/server.rb', line 60

def initialize(status, msg)
  @status = status
  @message = msg
  super(msg)
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



54
55
56
# File 'lib/coarnotify/server.rb', line 54

def message
  @message
end

#statusObject (readonly)

Returns the value of attribute status.



54
55
56
# File 'lib/coarnotify/server.rb', line 54

def status
  @status
end