Exception: RedisPrescription::ScriptError
- Defined in:
- lib/redis_prescription/errors.rb
Overview
Lua script eval/evalsha failure
Instance Attribute Summary collapse
-
#loc ⇒ Integer?
readonly
Line of code where error was encountered.
-
#source ⇒ String
readonly
Lua script source.
Instance Method Summary collapse
-
#initialize(message, source) ⇒ ScriptError
constructor
A new instance of ScriptError.
Constructor Details
#initialize(message, source) ⇒ ScriptError
Returns a new instance of ScriptError.
52 53 54 55 56 57 58 59 60 61 |
# File 'lib/redis_prescription/errors.rb', line 52 def initialize(, source) @source = -source.to_s if (parsed = LUA_ERROR_MESSAGE.match()) @loc = parsed[:loc].to_i = [parsed[:message], excerpt(@source, @loc)].compact.join("\n\n") end super() end |
Instance Attribute Details
#loc ⇒ Integer? (readonly)
Line of code where error was encountered
48 49 50 |
# File 'lib/redis_prescription/errors.rb', line 48 def loc @loc end |
#source ⇒ String (readonly)
Lua script source
43 44 45 |
# File 'lib/redis_prescription/errors.rb', line 43 def source @source end |