apidiesel 0.14 → 0.15

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
  SHA1:
3
- metadata.gz: e0004f40573101e0eb5c1e4b5ade4b83db6a1cf1
4
- data.tar.gz: 7da784a402c3518d5c08c0c22fc928478ba214b6
3
+ metadata.gz: 873c04eb2ac82ceffd0fa1099db4cc8d07e7f559
4
+ data.tar.gz: 6a7e3d77c247a66851bcced4798c0944b30b62fb
5
5
  SHA512:
6
- metadata.gz: 4daab8712e12862ae40666603b40b738044397df5868d4e578a9b127c8682062dfecc34709213d92e99db0b2e7e30ede9ea7f5e0776d7c4bd2f76ff3875c3226
7
- data.tar.gz: 993684cd775ab09b38dfa218c2ae181da0a34cfe3d4ad5736d8879b5d0b1c9ebd851498910bf458a27f0c5390ffde9d25355f4e494b6e1eb7fb0b6fc6ffa04b3
6
+ metadata.gz: a3e118d6ddf01b77bdad130f9218f0344a3e277f96269471057981d2aa772a5bfcf1b8d2ee154982eed84a0b3b07be8e0f430b75a072dd57556f1eb9c9655971
7
+ data.tar.gz: 3f8026f56c5e6e6d64434a3ca61f3284a4f79b6a6cb00970314aa3fdcb100336e88961b3fe4bd5b254e2d7fd3311a4ad79720b7f812cbd1998af27a7e21ef696
@@ -587,13 +587,17 @@ module Apidiesel
587
587
  response_formatters << lambda do |data, processed_data|
588
588
  return processed_data unless callable.call(data)
589
589
 
590
- message = message.is_a?(String) ? message : message.call(data)
591
-
592
- raise ResponseError.new(message)
590
+ raise ResponseError.new(error_message(message, data))
593
591
  end
594
592
  end
595
593
 
596
- protected
594
+ protected
595
+
596
+ def error_message(message, data)
597
+ return message if message.is_a?(String)
598
+ return message.call(data) if message.respond_to?(:call)
599
+ 'unknown error'
600
+ end
597
601
 
598
602
  def create_primitive_formatter(cast_method_symbol, *args, **kargs)
599
603
  args = normalize_arguments(args, kargs)
@@ -1,3 +1,3 @@
1
1
  module Apidiesel
2
- VERSION = "0.14"
2
+ VERSION = "0.15"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apidiesel
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.14'
4
+ version: '0.15'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan-Christian Foeh
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-05-04 00:00:00.000000000 Z
11
+ date: 2016-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport