led 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/led.rb +5 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a21ab33fb2807835562b391886b84e45e89e82fa
|
4
|
+
data.tar.gz: afe3ee4adfc69ddc739bb728532226fad6bc4566
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ab616d037a2101cdf6c4e280ca4d0e9e132221943d741bb1ee2bda5b780aa659cfd4d0740f9cb618662910580a35420de964cf1e64691a8b162106f67d462fc
|
7
|
+
data.tar.gz: a0a373537868b23250aac4de3c0c33b5a47d0aabeba7428467349c9f5cc00d19b1a0736065c9c2fef51f33b854e8b2b9fc55e990f33116efd856a6fa386a3170
|
data/lib/led.rb
CHANGED
@@ -39,12 +39,14 @@ module Led
|
|
39
39
|
@shas[m] = conn.script('load', @scripts[m])
|
40
40
|
conn.evalsha(@shas[m], [], args)
|
41
41
|
else
|
42
|
-
handle_command_error(e)
|
42
|
+
handle_command_error(e, m)
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
|
-
def self.handle_command_error(e)
|
47
|
-
if e.message =~
|
46
|
+
def self.handle_command_error(e, method)
|
47
|
+
if e.message =~ /^ERR.+user_script\:([0-9]+)\: (.+)$/
|
48
|
+
raise e, "#{method}.lua:#{$1}: #{$2}"
|
49
|
+
elsif e.message =~ /^([A-Z][a-zA-Z_0-9]+)(?:\:(.+))?/
|
48
50
|
klass = (Object.const_get($1) rescue Redis::CommandError)
|
49
51
|
raise klass, ($2 || '')
|
50
52
|
else
|