You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
810 B
26 lines
810 B
3 years ago
|
class ErrorsController < ApplicationController
|
||
|
skip_before_action :verify_authenticity_token
|
||
|
|
||
|
def not_found
|
||
|
respond_to do |format|
|
||
|
format.html { render status: :not_found }
|
||
|
format.json { render json: { error: "Resource not found" }, status: :not_found }
|
||
|
format.all { render status: :not_found, body: nil }
|
||
|
end
|
||
|
end
|
||
|
|
||
|
def internal_server_error
|
||
|
respond_to do |format|
|
||
|
format.html { render status: :internal_server_error }
|
||
|
format.json { render json: { error: "Internal server error" }, status: :internal_server_error }
|
||
|
end
|
||
|
end
|
||
|
|
||
|
def unprocessable_entity
|
||
|
respond_to do |format|
|
||
|
format.html { render status: :unprocessable_entity }
|
||
|
format.json { render json: { error: "Unprocessable entity" }, status: :unprocessable_entity }
|
||
|
end
|
||
|
end
|
||
|
end
|