Exception: Goliath::Validation::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/goliath/rack/validation_error.rb

Overview

A information about exceptions raised during validation.

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Goliath::Validation::Error) initialize(status_code, message)

Create a new Goliath::Validation::Error.

Examples:

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

Parameters:

  • (Integer) status_code

    The status code to return

  • (String) message

    The error message to return



16
17
18
19
# File 'lib/goliath/rack/validation_error.rb', line 16

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

Instance Attribute Details

- (Object) status_code

The status code to return from the error handler



6
7
8
# File 'lib/goliath/rack/validation_error.rb', line 6

def status_code
  @status_code
end