mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-03-14 00:50:14 -04:00
Option for verbose logging when API calls to create posts fail
This commit is contained in:
parent
fe6f587d4d
commit
5518141ad5
1 changed files with 4 additions and 0 deletions
|
@ -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 a new issue