crystal-lang / crystal

The Crystal Programming Language
https://crystal-lang.org
Apache License 2.0
19.2k stars 1.61k forks source link

Improve exception hierarchy #14737

Closed Blacksmoke16 closed 1 week ago

Blacksmoke16 commented 1 week ago

Implements what was proposed in https://github.com/crystal-lang/crystal/issues/11639#issuecomment-2090480502. Also not actually sure why I thought OverflowError inherited RuntimeError, so I handled that too.

straight-shoota commented 1 week ago

We need to be careful about the consequences. Introducing a completely new type into the hierarchy should be fine. But adding a new subtype relation for an existing exception class may cause issues.

I'd like to break this down into individual PRs, one for each parent type. This makes it more explizit what were changing and we can reason independently about each individual change.

Blacksmoke16 commented 1 week ago

@straight-shoota So 2 PRs? One for LogicError and one for Time::Error?

Blacksmoke16 commented 1 week ago

Closing in favor of #14742 and #14743