Skip to content

Commit

Permalink
closes #964 Improve error message for packet mutex breaking marshal dump
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanmelt committed Apr 2, 2019
1 parent 285a1f0 commit 31ca38b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/cosmos/top_level.rb
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,11 @@ def self.marshal_dump(marshal_filename, obj)
rescue Exception
# Oh well - we tried
end
if exception.class == TypeError and exception.message =~ /Thread::Mutex/
original_backtrace = exception.backtrace
exception = exception.exception("Mutex exists in a packet. Note: Packets must not be read during class initializers for Conversions, Limits Responses, etc.: #{exception}")
exception.set_backtrace(original_backtrace)
end
self.handle_fatal_exception(exception)
end
end
Expand Down

0 comments on commit 31ca38b

Please sign in to comment.