Class: ErrorsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/errors_controller.rb

Instance Method Summary collapse

Instance Method Details

#bad_requestObject

/400



3
4
5
6
7
# File 'app/controllers/errors_controller.rb', line 3

def bad_request
  Metric.register(Metric::METRIC_HTTP_400)

  render :error, status: :bad_request
end

#forbiddenObject

/403



17
18
19
20
21
# File 'app/controllers/errors_controller.rb', line 17

def forbidden
  Metric.register(Metric::METRIC_HTTP_403)

  render :error, status: :forbidden
end

#internal_server_errorObject

/500



38
39
40
41
42
# File 'app/controllers/errors_controller.rb', line 38

def internal_server_error
  Metric.register(Metric::METRIC_HTTP_500)

  render :error, status: :internal_server_error
end

#not_foundObject

/404



24
25
26
27
28
# File 'app/controllers/errors_controller.rb', line 24

def not_found
  Metric.register(Metric::METRIC_HTTP_404)

  render :error, status: :not_found
end

#unauthorizedObject

/401



10
11
12
13
14
# File 'app/controllers/errors_controller.rb', line 10

def unauthorized
  Metric.register(Metric::METRIC_HTTP_401)

  render :error, status: :unauthorized
end

#unprocessable_entityObject

422



31
32
33
34
35
# File 'app/controllers/errors_controller.rb', line 31

def unprocessable_entity
  Metric.register(Metric::METRIC_HTTP_422)

  render :error, status: :unprocessable_entity
end