Skip to content

Commit

Permalink
Better handling of unmarshalling issues, closes petergoldsteinGH-45
Browse files Browse the repository at this point in the history
  • Loading branch information
mperham committed Nov 21, 2010
1 parent 4647382 commit 1e174d8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/dalli/server.rb
Expand Up @@ -266,10 +266,10 @@ def deserialize(value, flags)
value = Zlib::Inflate.inflate(value) if (flags & FLAG_COMPRESSED) != 0
value = Marshal.load(value) if (flags & FLAG_MARSHALLED) != 0
value
rescue TypeError
raise DalliError, "Unable to unmarshal value: '#{value}'"
rescue TypeError, ArgumentError
raise DalliError, "Unable to unmarshal value: #{$!.message}"
rescue Zlib::Error
raise DalliError, "Unable to uncompress value: '#{value}'"
raise DalliError, "Unable to uncompress value: #{$!.message}"
end

def cas_response
Expand Down

0 comments on commit 1e174d8

Please sign in to comment.