From: "olleolleolle (Olle Jonsson) via ruby-core" Date: 2024-08-09T07:27:04+00:00 Subject: [ruby-core:118817] [Ruby master Feature#20669] Add Marshal::MarshalError class to differentiate ArgumentErrors Issue #20669 has been updated by olleolleolle (Olle Jonsson). Description updated Changed the proposal to be about one error class. Thanks, KJ! ---------------------------------------- Feature #20669: Add Marshal::MarshalError class to differentiate ArgumentErrors https://bugs.ruby-lang.org/issues/20669#change-109376 * Author: olleolleolle (Olle Jonsson) * Status: Open ---------------------------------------- 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 error class deriving from ArgumentError could be introduced in Marshal? Say, Marshal::MarshalError deriving from ArgumentError? Something backwards-compatible. [Dalli PR where another error message would be added](https://github.com/petergoldstein/dalli/pull/1008) -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/