Project

General

Profile

Feature #20669

Updated by olleolleolle (Olle Jonsson) 4 days ago

## Abstract 

 Add a `Marshal::MarshalError` error class to be raised on failing to load data. 

 ## Background 

 Currently, `ArgumentError` is raised when failing to load data.  

 Memcache client 

 ## Proposal 

 Add a `Marshal::MarshalError` error class to be raised on failing to load data. 

 ## Use cases 

 Dalli tries to differentiate errors that have to do with Marshal.load by pattern-matching on "message" in these ArgumentError instances. If there were a way to tell "this was Marshal.load failing", it'd be more robust. nice. Example: [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). 

 ## Proposal Discussion 

 Add a `Marshal::MarshalError` error class to be raised on failing to load data. ... 

 ## See also 

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

Back