Class: ApiErrorsController
Constant Summary
ApplicationHelper::CONFIG
Instance Method Summary
collapse
#authenticate_admin!, #not_found, #redirect_vonage_domain
#active_sidenav_item, #canonical_base, #canonical_base_from_config, #canonical_path, #canonical_url, #dashboard_cookie, #search_enabled?, #set_utm_cookie, #theme
Instance Method Details
#index ⇒ Object
5
6
7
8
9
10
11
12
13
14
15
|
# File 'lib/nexmo_developer/app/controllers/api_errors_controller.rb', line 5
def index
@errors_title = 'Generic Errors'
@errors = generic_errors
@scoped_errors = @error_config['products'].map do |key, config|
{
key: key,
config: config,
errors: scoped_errors(key),
}
end
end
|
#index_scoped ⇒ Object
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/nexmo_developer/app/controllers/api_errors_controller.rb', line 17
def index_scoped
oas = params[:definition]
oas = params[:subapi] if params[:subapi] == 'subaccounts'
@errors_title = @error_config['products'][oas]['title']
@hide_rfc7807_header = @error_config['products'][oas]['hide_rfc7807_header']
@errors = scoped_errors(oas)
render 'index'
end
|
#show ⇒ Object
28
29
30
31
32
33
34
|
# File 'lib/nexmo_developer/app/controllers/api_errors_controller.rb', line 28
def show
if params[:definition]
@error = scoped_error(params[:definition], params[:id])
else
@error = ApiError.new(@error_config['generic_errors'][params[:id]])
end
end
|