|
@@ -7,6 +7,11 @@ class API::V1::ApplicationController < ActionController::API
|
|
|
|
|
|
|
|
rescue_from StandardError, with: :handle_unhandled_api_error
|
|
rescue_from StandardError, with: :handle_unhandled_api_error
|
|
|
|
|
|
|
|
|
|
+ def not_found
|
|
|
|
|
+ @error = APIError::BaseError.new("The requested resource was not found")
|
|
|
|
|
+ render partial: 'error', status: :not_found
|
|
|
|
|
+ end
|
|
|
|
|
+
|
|
|
private
|
|
private
|
|
|
|
|
|
|
|
def handle_unhandled_api_error(e)
|
|
def handle_unhandled_api_error(e)
|
|
@@ -17,6 +22,6 @@ class API::V1::ApplicationController < ActionController::API
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
def set_default_response_format
|
|
def set_default_response_format
|
|
|
- #request.format = :json
|
|
|
|
|
|
|
+ request.format = :json
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|