ruby / net-imap

Ruby client api for Internet Message Access Protocol
https://ruby.github.io/net-imap
Other
62 stars 29 forks source link

🥅 Improve SequenceSet frozen errors #331

Closed nevans closed 1 month ago

nevans commented 1 month ago

Previously, SequenceSet modification methods would raise a frozen error when it updated its internal data structure (currently implemented as an array of arrays), which was "can't modify frozen Array: [int, int]". This was unexpected, confusing, and misleading.

This changes the SequenceSet modification methods to raise the expected FrozenError prior to attempting to modify the internal data structure.