Skip to content

Commit

Permalink
Merge pull request #746 from Mashape/chore/errors
Browse files Browse the repository at this point in the history
Properly printing DAO errors
  • Loading branch information
subnetmarco committed Nov 30, 2015
2 parents 24cc4e8 + 8cd17d6 commit ba2259a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion kong/core/certificate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function _M.execute()
if server_name then -- Only support SNI requests
local api, err = find_api({server_name})
if err then
ngx.log(ngx.ERR, err)
ngx.log(ngx.ERR, tostring(err))
end

return api
Expand Down
2 changes: 1 addition & 1 deletion kong/dao/cassandra/base_dao.lua
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ function BaseDao:_execute(query, args, options, keyspace)

-- Handle unprepared queries
if err and err.cassandra_err_code == cassandra_constants.error_codes.UNPREPARED then
ngx.log(ngx.NOTICE, "Cassandra did not recognize prepared statement \""..cache_key.."\". Re-preparing it and re-trying the query. (Error: "..err..")")
ngx.log(ngx.NOTICE, "Cassandra did not recognize prepared statement \""..cache_key.."\". Re-preparing it and re-trying the query. (Error: "..tostring(err)..")")
-- If the statement was declared unprepared, clear it from the cache, and try again.
self._statements_cache[session_uniq_addr(session)][cache_key] = nil
return self:_execute(query, args, options)
Expand Down
2 changes: 1 addition & 1 deletion kong/plugins/response-ratelimiting/log.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ local function increment(api_id, identifier, current_timestamp, value, name)
-- Increment metrics for all periods if the request goes through
local _, stmt_err = dao.response_ratelimiting_metrics:increment(api_id, identifier, current_timestamp, value, name)
if stmt_err then
ngx.log(ngx.ERR, stmt_err)
ngx.log(ngx.ERR, tostring(stmt_err))
end
end

Expand Down

0 comments on commit ba2259a

Please sign in to comment.