Skip to content

Commit

Permalink
Add function for a release field
Browse files Browse the repository at this point in the history
  • Loading branch information
cycomachead committed Feb 26, 2021
1 parent 9bd5842 commit 7918108
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions raven/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ function _M.get_request_data()
return {}
end

--- This method can be used to tag a release in Sentry.
-- Typically you can use it with a commit hash.
function _M.get_release()
return ''

This comment has been minimized.

Copy link
@nevmerzhitsky

nevmerzhitsky Jul 27, 2022

The implementation must return nil else Sentry will fire about release field parsing error, because empty string is not an allowed value, but null is OK.

This comment has been minimized.

Copy link
@cycomachead

cycomachead Aug 1, 2022

Author Member

Thanks for the note! This makes sense. I think I've always overridden this in my own use, but I'll push a fix.

end

--- This table can be used to tune the message reporting.
-- @field tags Tags for the message, they will be coalesced with the ones
-- provided in the @{sentry_conf} table used in the constructor if any. In
Expand Down Expand Up @@ -334,6 +340,7 @@ function raven_mt:send_report(json, conf)

json.request = _M.get_request_data()
json.server_name = _M.get_server_name()
json.releae = _M.get_release()

local json_str = json_encode(json)
local ok, err = self.sender:send(json_str)
Expand Down

0 comments on commit 7918108

Please sign in to comment.