diff --git a/shard.yml b/shard.yml index fcfa20e..63b9d1a 100644 --- a/shard.yml +++ b/shard.yml @@ -1,5 +1,5 @@ name: raven -version: 1.9.0 +version: 1.9.1 authors: - Sijawusz Pur Rahnama diff --git a/src/raven/integrations/http/handler.cr b/src/raven/integrations/http/handler.cr index b61afd4..18ed842 100644 --- a/src/raven/integrations/http/handler.cr +++ b/src/raven/integrations/http/handler.cr @@ -30,7 +30,7 @@ module Raven end protected def cookies_to_string(cookies : HTTP::Cookies) - cookies.to_h.map(&.last.to_cookie_header).join "; " + cookies.to_h.join("; ") { |_, cookie| cookie.to_cookie_header } end abstract def build_raven_culprit_context(context : HTTP::Server::Context) diff --git a/src/raven/interfaces/message.cr b/src/raven/interfaces/message.cr index 5c3becb..9ec4d01 100644 --- a/src/raven/interfaces/message.cr +++ b/src/raven/interfaces/message.cr @@ -8,8 +8,8 @@ module Raven end def unformatted_message - if params = @params - params.empty? ? message? : message?.try { |m| m % params } + if (params = @params) && !params.empty? + message?.try(&.% params) else message? end diff --git a/src/raven/log_backend.cr b/src/raven/log_backend.cr index fa27d19..0c0ac75 100644 --- a/src/raven/log_backend.cr +++ b/src/raven/log_backend.cr @@ -53,7 +53,7 @@ module Raven # See `Event#logger`, `Breadcrumb#category` property default_logger : String - {% if compare_versions(Crystal::VERSION, "1.0.0-dev") >= 0 %} + {% if compare_versions(Crystal::VERSION, "0.35.1") > 0 %} def initialize( dispatch_mode : ::Log::DispatchMode = :sync, *, diff --git a/src/raven/processors/utf8_conversion.cr b/src/raven/processors/utf8_conversion.cr index ffe1e4f..c1d0600 100644 --- a/src/raven/processors/utf8_conversion.cr +++ b/src/raven/processors/utf8_conversion.cr @@ -12,9 +12,9 @@ module Raven when Exception return data unless message = data.message return data if message.valid_encoding? - data.class.new(clean_invalid_utf8_bytes(message), data.cause).tap do |ex| - ex.callstack = data.callstack - end + data.class + .new(clean_invalid_utf8_bytes(message), data.cause) + .tap(&.callstack=(data.callstack)) when String return data if data.valid_encoding? clean_invalid_utf8_bytes(data)