error_response 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/error_response.rb +2 -7
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd43647dc406683c0562945f7bffa780d26dbb15cc3fe6595027887e492a5cc0
4
- data.tar.gz: 7820e4d0867e45a9f38e57630e967f12fd782144d078e4116696b10bbd228a53
3
+ metadata.gz: 942aeb3cb71ffd7c3adff6fd0d30d200ec1179eac0252f9c3d73c19530ef3226
4
+ data.tar.gz: 077bcdd308abe7d3eaf1a849594b9f25d056e52447c83a7b93ce6014d440c19b
5
5
  SHA512:
6
- metadata.gz: 915b407b7ae666af601e28e6e023bd41ccc1c3894424ec63b17eca0d4dd47e72ee02ddab4355e308cc4439dfafd9d67652701ed8a2a7ae11596de785c79a251a
7
- data.tar.gz: 37a5c49b15cb0ea5ab80bc425376b733c512451bde1c355349ae0dca0bf6c88e33039d6651c753e9fe7155a486bd39107c7fd68c5265b8927fb042076ce417a5
6
+ metadata.gz: 64c7a9948a528a8cb85c188538cb885802483e4752aa8ad98fcad13e5f4cd65245e78dc5f5c8967a26c3345d3668b46b06840a2bd77207396f4b2075ca97d62b
7
+ data.tar.gz: a27250609dee2141be6f848f95588ea150b8f6ff9d080886ba47175b6fea7476e56fa13487e5e335e4508e9de479c993a4c3a0b76a53e712d43a24f70a88703a
@@ -14,13 +14,8 @@ class ErrorResponse
14
14
  end
15
15
 
16
16
  def self.to_api(key, message=nil)
17
- default_result = {
18
- status: 500,
19
- json: { 'error_code' => 500_000, 'error_message' => message }
20
- }
21
- return default_result unless yaml_hash.key?(key.to_s)
22
-
23
- json = yaml_hash[key.to_s].merge({ 'error_key' => key.to_s })
17
+ json = yaml_hash[key.to_s] || { 'error_code' => 500_000, 'error_message' => key.to_s }
18
+ json['error_key'] = key.to_s
24
19
  json['error_message'] += ": #{message}" unless message.nil?
25
20
  {
26
21
  status: parse_status(json['error_code']),
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: error_response
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kdan Mobile Software Developer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-13 00:00:00.000000000 Z
11
+ date: 2022-03-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: use for error_response
14
14
  email: dev@kdanmobile.com