mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 09:26:54 -06:00
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]
|
||||
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
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user