rubypitaya 3.3.0 → 3.3.4

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: f57bbdb5e9f7f12097c4013871c3947a1655e3c79fe31b9e259d911c0563ef0d
4
- data.tar.gz: bd54ecb7812fd7d16573f986f274abf0949cd0a7d460ec30ece58bef51201ec2
3
+ metadata.gz: 3e526e596bef23aa113c700a8e2ab6311241ebd9257d2f030026cf53ed3d49d5
4
+ data.tar.gz: 5f932845d7c382c26c4c948508fd1855fb4dfb3eecc533f0560c378ce6c87f92
5
5
  SHA512:
6
- metadata.gz: 2440c10e3c923ccfbe29e6730bbfae01385caf00a8d9c2aff001740c5f3e91670d8cfc020bfd4655fd143062a1a1921a21dcc6846424cef48403344b9841497b
7
- data.tar.gz: 2beb8d98dade8520167c774714bb71673ee6f8329494a8b0a80674ac44f63384b50dd2af32dd20e01975dcb622a0624c74457fd730ea6a77b44ea821dfb41ed6
6
+ metadata.gz: 025faa43f9e73e44f79a6cad82815ba445fb14be623a99dcf560200b2d4002b5fdf2e3ab8429eefd5110aa30611ca5eb3965f01da65ed6c3ba06e386962294e4
7
+ data.tar.gz: 4d8f19ca632af76c3329a9d658522089d776baba03b6fc6c83e8e61e8607b26479738d5836feb08da52967d82ddf606bfc92fec026d1849d190018dffb45230e
@@ -1,6 +1,6 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- gem 'rubypitaya', '3.3.0'
3
+ gem 'rubypitaya', '3.3.4'
4
4
 
5
5
  group :development do
6
6
  gem 'pry', '0.14.1'
@@ -103,7 +103,7 @@ GEM
103
103
  rspec-support (~> 3.10.0)
104
104
  rspec-support (3.10.3)
105
105
  ruby2_keywords (0.0.5)
106
- rubypitaya (3.3.0)
106
+ rubypitaya (3.3.4)
107
107
  activerecord (= 6.1.4.1)
108
108
  etcdv3 (= 0.11.4)
109
109
  google-protobuf (= 3.18.1)
@@ -143,7 +143,7 @@ DEPENDENCIES
143
143
  listen (= 3.7.0)
144
144
  pry (= 0.14.1)
145
145
  rspec (= 3.10.0)
146
- rubypitaya (= 3.3.0)
146
+ rubypitaya (= 3.3.4)
147
147
  sinatra-contrib (= 2.1.0)
148
148
 
149
149
  BUNDLED WITH
@@ -10,6 +10,7 @@ require 'rubypitaya/core/session'
10
10
  require 'rubypitaya/core/postman'
11
11
  require 'rubypitaya/core/parameters'
12
12
  require 'rubypitaya/core/http_routes'
13
+ require 'rubypitaya/core/route_error'
13
14
  require 'rubypitaya/core/routes_base'
14
15
  require 'rubypitaya/core/status_codes'
15
16
  require 'rubypitaya/core/handler_router'
@@ -179,10 +180,20 @@ module RubyPitaya
179
180
 
180
181
  @config.clear_cache
181
182
 
182
- response = @handler_router.call(handler_name, action_name, @session,
183
- @postman, @redis_connector.redis,
184
- @mongo_connector.mongo, @setup, @config,
185
- @log, params)
183
+ response = {}
184
+
185
+ begin
186
+ response = @handler_router.call(handler_name, action_name, @session,
187
+ @postman, @redis_connector.redis,
188
+ @mongo_connector.mongo, @setup, @config,
189
+ @log, params)
190
+ rescue RouteError => error
191
+ @log.error "ROUTE ERROR: #{error.class} | #{error.message}} \n #{error.backtrace.join("\n")}"
192
+ response = {
193
+ code: error.code,
194
+ message: error.message
195
+ }
196
+ end
186
197
 
187
198
  delta_time_seconds = ((Time.now.to_f - start_time_seconds) * 1000).round(2)
188
199
 
@@ -190,12 +201,6 @@ module RubyPitaya
190
201
 
191
202
  response
192
203
  end
193
- rescue RubyPitaya::Error => error
194
- @log.error "ROUTE ERROR: #{error.class} | #{error.message}} \n #{error.backtrace.join("\n")}"
195
- response = {
196
- code: error.code,
197
- message: error.message
198
- }
199
204
  rescue Exception => error
200
205
  @log.error "INTERNAL ERROR: #{error.class} | #{error.message}} \n #{error.backtrace.join("\n")}"
201
206
  run_nats_connection
@@ -0,0 +1,13 @@
1
+ module RubyPitaya
2
+ class RouteError < StandardError
3
+
4
+ attr_reader :code, :message
5
+
6
+ def initialize(code, message)
7
+ @code = code
8
+ @message = message
9
+
10
+ super(message)
11
+ end
12
+ end
13
+ end
@@ -1,3 +1,3 @@
1
1
  module RubyPitaya
2
- VERSION = '3.3.0'
2
+ VERSION = '3.3.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubypitaya
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.0
4
+ version: 3.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luciano Prestes Cavalcanti
@@ -339,7 +339,6 @@ files:
339
339
  - "./lib/rubypitaya/core/config_core.rb"
340
340
  - "./lib/rubypitaya/core/database_config.rb"
341
341
  - "./lib/rubypitaya/core/database_connector.rb"
342
- - "./lib/rubypitaya/core/error.rb"
343
342
  - "./lib/rubypitaya/core/etcd_connector.rb"
344
343
  - "./lib/rubypitaya/core/handler_base.rb"
345
344
  - "./lib/rubypitaya/core/handler_router.rb"
@@ -359,6 +358,7 @@ files:
359
358
  - "./lib/rubypitaya/core/protos/nats_connector.proto"
360
359
  - "./lib/rubypitaya/core/protos/nats_connector_pb.rb"
361
360
  - "./lib/rubypitaya/core/redis_connector.rb"
361
+ - "./lib/rubypitaya/core/route_error.rb"
362
362
  - "./lib/rubypitaya/core/routes_base.rb"
363
363
  - "./lib/rubypitaya/core/session.rb"
364
364
  - "./lib/rubypitaya/core/setup.rb"
@@ -1,9 +0,0 @@
1
- class RubyPitayaError < StandardError
2
-
3
- def initialize(code, message)
4
- @code = code
5
- @message = message
6
-
7
- super(message)
8
- end
9
- end