Project

General

Profile

Feature #20669

Updated by olleolleolle (Olle Jonsson) 4 days ago

Currently, Marshal.load raises ArgumentErrors on failure. 

 In the memcache client Dalli, there is [a regular expression to check for a few of the ArgumentErrors that can be raised during Marshal.load](https://github.com/petergoldstein/dalli/blob/v3.2.8/lib/dalli/protocol/value_serializer.rb#L41). 

 In order to make it easier to work with, perhaps a new individual error class classes deriving from ArgumentError could be introduced in Marshal? Say, Marshal::MarshalError Perhaps a MarshalError base class deriving from ArgumentError? Something backwards-compatible. 

 [Dalli PR where another error message would be added](https://github.com/petergoldstein/dalli/pull/1008)

Back