rsmp-nordic / rsmp

Ruby gem for handling RoadSide Message Protocol (RMSP) communication
MIT License
1 stars 1 forks source link

Bug: undefined local variable or method `e' #35

Closed otterdahl closed 2 years ago

otterdahl commented 2 years ago

There is an issue with test case "Site::Traffic Light Controller Signal Group follows startup sequence after restart"

See https://github.com/rsmp-nordic/rsmp_validator/runs/5155112672?check_suite_focus=true#step:5:1185

undefined local variable or method `e' for #<RSMP::SiteProxy:31520, @archive: #

     dont_acknowledge message, str, "#{e}"

                                        ^ in task: #<Async::Task:0x9f4c reader (running)>

Would this change fix the issue?

--- a/lib/rsmp/site_proxy.rb
+++ b/lib/rsmp/site_proxy.rb
@@ -72,7 +72,7 @@ module RSMP
         else
           super message
       end
-    rescue RSMP::RepeatedAlarmError, RSMP::RepeatedStatusError
+    rescue RSMP::RepeatedAlarmError => e, RSMP::RepeatedStatusError => e
       str = "Rejected #{message.type} message,"
       dont_acknowledge message, str, "#{e}"
       notify_error e.exception("#{str}#{e.message} #{message.json}")
emiltin commented 2 years ago

as you suggsted @otterdahl. it was a regresssion after a recent refactor