yabeda-rails 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 107b2a512068172c19c08b18dc0f452d9ee1794c4894979b1a88c459a8dcf5c5
4
- data.tar.gz: 686e32000199bc29bb8096d09aa336b4cf67d9cfe789e44b91653467caee5524
3
+ metadata.gz: 95166b3713d896663737aaf5fb6c485df43557d946c510f957fb3ab42e3e0d38
4
+ data.tar.gz: 0a8c2b72c450564b8fad46c1ac67c9895f342366d36d967611f576bd63275cea
5
5
  SHA512:
6
- metadata.gz: f59dd373f43b40e47b03cecef02ad47ce8fdcf49661430fddf003007f60d69895a26e538d23bd829e664aaa27145789f2a934ed401d6c593ca314ff3271d65d2
7
- data.tar.gz: 6de6d25b29ef13f07f9a1e008999577c18891ceaede127a99ac541235442ed72f3b74316e6f7b16950169fd5309e6d1fcc86cf2b4999106ff08a46349db27e0b
6
+ metadata.gz: 512a1d39088979606534b7de183e26aeed5aa2b7d4f2394b8b21cfb0b9ceec0735e35d34ef7a3a8a738468f4fc72d28a1825604f143a00b88e2649bcfd5b44dd
7
+ data.tar.gz: cc4b86dab98e360b4d5b481a593533f60f0d5af3d70a0acda3f45935968097eef02fef32ec6b65e57bc260a0d3d7f34561b2584f3f0a001da238e182b7bfd285
data/CHANGELOG.md CHANGED
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
6
6
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## 0.8.1 - 2022-06-06
9
+
10
+ ### Fixed
11
+
12
+ - Fill status codes for responses with unhandled exceptions. [@dks17][] in [#24](https://github.com/yabeda-rb/yabeda-rails/pull/24)
13
+
8
14
  ## 0.8.0 - 2022-05-30
9
15
 
10
16
  ### Added
@@ -78,3 +84,4 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
78
84
  [@Envek]: https://github.com/Envek "Andrey Novikov"
79
85
  [@liaden]: https://github.com/liaden "Joel Johnson"
80
86
  [@lautis]: https://github.com/lautis "Ville Lautanala"
87
+ [@dks17]: https://github.com/dks17 "Konstantin"
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Yabeda
4
4
  module Rails
5
- VERSION = "0.8.0"
5
+ VERSION = "0.8.1"
6
6
  end
7
7
  end
data/lib/yabeda/rails.rb CHANGED
@@ -58,7 +58,7 @@ module Yabeda
58
58
  labels = {
59
59
  controller: event.payload[:params]["controller"],
60
60
  action: event.payload[:params]["action"],
61
- status: event.payload[:status],
61
+ status: Yabeda::Rails.event_status_code(event),
62
62
  format: event.payload[:format],
63
63
  method: event.payload[:method].downcase,
64
64
  }
@@ -80,6 +80,14 @@ module Yabeda
80
80
  def ms2s(milliseconds)
81
81
  (milliseconds.to_f / 1000).round(3)
82
82
  end
83
+
84
+ def event_status_code(event)
85
+ if event.payload[:status].nil? && event.payload[:exception].present?
86
+ ActionDispatch::ExceptionWrapper.status_code_for_exception(event.payload[:exception].first)
87
+ else
88
+ event.payload[:status]
89
+ end
90
+ end
83
91
  end
84
92
  end
85
93
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yabeda-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Novikov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-05-30 00:00:00.000000000 Z
11
+ date: 2022-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport