Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Crystal::Exception to Crystal::CodeError #10197

Conversation

straight-shoota
Copy link
Member

This patch introduces Crystal::Error as base class for all compiler errors and renames Crystal::Exception to Crystal::CodeError.

Crystal::LocationlessException as a more specific error type is unnecessary. The relationship is now reversed: CodeError < Error (previously: LocationlessException < Exception) and Crystal::Error is used as exception type for non code-related errors.

@Fryguy
Copy link
Contributor

Fryguy commented Jan 5, 2021

Naming-wise, if the Crystal:: namespace implies "compiler", then Crystal::Error seems good otherwise I'd suggest something like Crystal::CompilerError or Crystal::CompilationError

@straight-shoota
Copy link
Member Author

@Fryguy Good call. Indeed Crystal namespace is also used by the language runtime. But I don't think this overlap is a problem, at least not for this PR.

@straight-shoota straight-shoota added this to the 1.0.0 milestone Jan 6, 2021
@asterite asterite linked an issue Jan 6, 2021 that may be closed by this pull request
@asterite asterite merged commit 902060d into crystal-lang:master Jan 6, 2021
@straight-shoota straight-shoota deleted the refactor/compiler-locationless-exception branch January 6, 2021 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants