Project

General

Profile

Actions

Refactor #11169

open

Use render_error instead of render_message for API text error responses

Added by Dominic Cleal almost 9 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
API
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

We have two helpers for returning a "message" in an API response, one that's a plain "message" node (render_message) and one that wraps it in an "error" layout (render_error with custom_error view).

render_message should probably be used when the operation was successful, e.g. default PXE menu build, but render_error should be used when an exception or error is raised.

Check usage of render_message for any that should be using the regular exception handler (e.g. app/controllers/api/v2/operatingsystems_controller.rb, bootfiles) or using render_error (app/controllers/api/v2/hostgroups_controller.rb, destroy).

No data to display

Actions

Also available in: Atom PDF