beekeeper 0.1.10 → 0.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/beekeeper/logger.rb +8 -4
- data/lib/beekeeper/rescuer.rb +4 -1
- data/lib/beekeeper/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 035ab20ad054e4b16ca26bdc92194b00cf66a6feac49fda56853d8fac146c040
|
4
|
+
data.tar.gz: d33daa2eefbf2cdc1125694b3a6b2d459b041e6becbc070d66b9d6f686ee4661
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dcd3fc0caaa472eefa8ea27787df31db48d3563d16efde80a34812fff903e687155af3ea39dc4e8ee3188e16055e0c867abb1e89e063cb691d64257560b2b4d6
|
7
|
+
data.tar.gz: a820189ee799fe8de516f45f727972404ddb82737ef70d4036c5cc017b9d864feed4211a489f3cf7ba23e099ccfa903d13175c5e9303ba5eb541122a2a12dba0
|
data/lib/beekeeper/logger.rb
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
module Beekeeper
|
2
2
|
class Logger
|
3
|
-
def self.fatal(error)
|
3
|
+
def self.fatal(error, logger: nil)
|
4
4
|
message = if error.respond_to? :backtrace
|
5
5
|
message_with_backtrace(error)
|
6
6
|
else
|
7
7
|
error
|
8
8
|
end
|
9
|
-
|
9
|
+
internal_logger(logger).fatal message
|
10
10
|
end
|
11
11
|
|
12
|
-
def self.error(error)
|
12
|
+
def self.error(error, logger: nil)
|
13
13
|
message = if error.respond_to? :backtrace
|
14
14
|
message_with_backtrace(error)
|
15
15
|
else
|
16
16
|
error
|
17
17
|
end
|
18
|
-
|
18
|
+
internal_logger(logger).error message
|
19
19
|
end
|
20
20
|
|
21
21
|
private
|
@@ -32,6 +32,10 @@ module Beekeeper
|
|
32
32
|
bc.clean(backtrace).map! { |t| " #{t}\n" }
|
33
33
|
end
|
34
34
|
|
35
|
+
def internal_logger(logger)
|
36
|
+
logger || Rails.logger
|
37
|
+
end
|
38
|
+
|
35
39
|
end
|
36
40
|
end
|
37
41
|
|
data/lib/beekeeper/rescuer.rb
CHANGED
@@ -7,7 +7,10 @@ module Beekeeper
|
|
7
7
|
RESCUABLE_ERRORS = [
|
8
8
|
::Beekeeper::Error,
|
9
9
|
::Apipie::Error,
|
10
|
-
::ActiveRecord::RecordInvalid
|
10
|
+
::ActiveRecord::RecordInvalid,
|
11
|
+
::ActiveRecord::RecordNotUnique,
|
12
|
+
::ActiveRecord::RecordNotFound,
|
13
|
+
::ActiveRecord::ActiveRecordError,
|
11
14
|
]
|
12
15
|
|
13
16
|
rescue_from(*RESCUABLE_ERRORS, with: :handle_error)
|
data/lib/beekeeper/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beekeeper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Omkar Joshi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-09-
|
11
|
+
date: 2020-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|