Exception: Goliath::Validation::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/goliath/validation/error.rb

Overview

A information about exceptions raised during validation.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status_code, message) ⇒ Goliath::Validation::Error

Create a new Goliath::Validation::Error.

Examples:

raise Goliath::Validation::Error.new(401, "Invalid credentials")

Parameters:

  • status_code (Integer)

    The status code to return

  • message (String)

    The error message to return



16
17
18
19
# File 'lib/goliath/validation/error.rb', line 16

def initialize(status_code, message)
  super(message)
  @status_code = status_code
end

Instance Attribute Details

#status_codeObject

The status code to return from the error handler



6
7
8
# File 'lib/goliath/validation/error.rb', line 6

def status_code
  @status_code
end