Option for verbose logging when API calls to create posts fail
This commit is contained in:
parent
fe6f587d4d
commit
5518141ad5
|
@ -458,6 +458,10 @@ class PostsController < ApplicationController
|
||||||
json_obj = json_obj[:post]
|
json_obj = json_obj[:post]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if !success && GlobalSetting.try(:verbose_api_logging) && is_api?
|
||||||
|
Rails.logger.error "Error creating post via API:\n\n#{json_obj.inspect}"
|
||||||
|
end
|
||||||
|
|
||||||
render json: json_obj, status: (!!success) ? 200 : 422
|
render json: json_obj, status: (!!success) ? 200 : 422
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue