beekeeper 0.1.8 → 0.1.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d2e59a97870e4ff992512cfd825ea70d3ee508c1b22299484d0e7bcb5650dec3
4
- data.tar.gz: f329c4677c876ad554bf446f5b3bab061cf037ee86ab4881ad07ea5ddec34c6d
3
+ metadata.gz: 13d1b902fc01a6d87135ee041388be0e14390d1b200ca08bdabe076195a6c3ff
4
+ data.tar.gz: 24d2be448f6acac11cdb346d9949e1acc3f06eee5fd643051db953a4ec9417f1
5
5
  SHA512:
6
- metadata.gz: 81110a70e01c7ab375c59621b79af6ea78dbcb15bf70770d5eb082e5f05e924f87a66b7a982aa39f595f847e0c43a9e333e9e42ec7aa133bb2d078c08a2d4463
7
- data.tar.gz: 78316c16c36cf72850603d223a68b7fd5756e586f58d1d99d22df2c840616a02f7da5ef357113b6ecae268defeda86e7764eed11cf9f81c4d71c6bd0e76ca59c
6
+ metadata.gz: d02a147f229256d860461d149835f9f82f565064f05f563ab931b5cc5cf6ce6152f7fb2fe9db796215cd47baeef8462c2a982d74381918fe39967fc2344adcb5
7
+ data.tar.gz: b18cd2f52461edda3e6aa9692ebb439860bdddc6a73b986cb80228d593eec92940e178c54bec5f20f8a1986916d947aaad2c443c5a050d015fa2a0968585976c
@@ -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
- Rails.logger.fatal message
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
- Rails.logger.error message
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 self.internal_logger(logger)
36
+ logger || Rails.logger
37
+ end
38
+
35
39
  end
36
40
  end
37
41
 
@@ -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)
@@ -16,11 +16,11 @@ module Beekeeper
16
16
  request = ActionDispatch::Request.new env
17
17
  @app.call(env)
18
18
  rescue StandardError => e
19
- if request.path_info.include? '/api'
19
+ # if request.path_info.include? '/api'
20
20
  render_json_error(request, e)
21
- else
22
- raise e
23
- end
21
+ # else
22
+ # raise e
23
+ # end
24
24
  end
25
25
 
26
26
  private
@@ -1,3 +1,3 @@
1
1
  module Beekeeper
2
- VERSION = '0.1.8'
2
+ VERSION = '0.1.13'
3
3
  end
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.8
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Omkar Joshi
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-26 00:00:00.000000000 Z
11
+ date: 2020-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -28,30 +28,58 @@ dependencies:
28
28
  name: blueprinter
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.23.4
34
- type: :development
33
+ version: '0'
34
+ type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 0.23.4
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: oj
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: apipie-rails
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: sqlite3
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
46
74
  - !ruby/object:Gem::Version
47
- version: 3.10.6
75
+ version: '0'
48
76
  type: :development
49
77
  prerelease: false
50
78
  version_requirements: !ruby/object:Gem::Requirement
51
79
  requirements:
52
- - - "~>"
80
+ - - ">="
53
81
  - !ruby/object:Gem::Version
54
- version: 3.10.6
82
+ version: '0'
55
83
  description: 'Beekeepeer: This gem is responsible for error logging, processing and
56
84
  rendering of errors in a standard JSON format..'
57
85
  email:
@@ -72,12 +100,12 @@ files:
72
100
  - lib/beekeeper/trap_api_exceptions.rb
73
101
  - lib/beekeeper/version.rb
74
102
  - lib/tasks/beekeeper_tasks.rake
75
- homepage: https://github.com/josho1/beekeeper
103
+ homepage: https://github.com/joshio1/beekeeper
76
104
  licenses:
77
105
  - MIT
78
106
  metadata:
79
107
  allowed_push_host: https://rubygems.org
80
- post_install_message:
108
+ post_install_message:
81
109
  rdoc_options: []
82
110
  require_paths:
83
111
  - lib
@@ -93,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
121
  version: '0'
94
122
  requirements: []
95
123
  rubygems_version: 3.0.3
96
- signing_key:
124
+ signing_key:
97
125
  specification_version: 4
98
- summary: 'Beekeeper: Error logging, processing and rendering.'
126
+ summary: 'Beekeeper: Error logging, processing and rendering via Rack middleware.'
99
127
  test_files: []