Skip to content

Update exception terminology to clarify types of exceptions #2954

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

BahaaMohamed98
Copy link
Contributor

pull request

Clarify classification of exceptions and errors in Java introduction

This PR:

  • Distinguishes clearly between exceptions and errors
  • Clarifies that errors are not exceptions
  • Moves the section on errors into its own separate category

Reviewer Resources:

Track Policies

@jagdish-15
Copy link
Contributor

Hey @BahaaMohamed98,

Did you happen to discuss these changes on the Exercism forum before opening the PR?
If you’ve already created a topic, please share the link here. Otherwise, you should start a discussion there first and then proceed with the PR.

@BahaaMohamed98
Copy link
Contributor Author

Hey @jagdish-15! You're right — I forgot to open a forum topic first 😅
I'll go ahead and create one now and link it here shortly. Thanks for the heads up!

@BahaaMohamed98
Copy link
Contributor Author

Just created the discussion here: http://forum.exercism.org/t/clarifying-error-vs-exception-in-java-exception-concept/17914

Copy link
Member

@kahgoh kahgoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @BahaaMohamed98, the general idea behind these changes seem reasonable to me. Since the content between the introduction and about are similar, I've added comments to just the introduction. If it helps, feel free to make update or make changes to just the introduction and we can update the other files later once we're happy.

@@ -21,7 +20,7 @@ An example of a checked exception is the `FileNotFoundException` which occurs wh

This type of exception is checked at compile-time: methods that throw checked exceptions should specify this in their method signature, and code calling a method that might throw a checked exception is required to handle it or the code will not compile.

All exceptions in Java that do not inherit from `RuntimeException` or `Error` are considered checked exceptions.
All exceptions in Java that do not inherit from `RuntimeException` are checked exceptions.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should mention the Exception class somewhere since RuntimeException extends Exception.


### Errors
## Errors
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that Errors has been "promoted' to a level 2 heading, it looks like it sitting in between two Exception sections. I think it might flow better if this was moved after the Handling Exception section so that the entire Exception content was "together".

Comment on lines 39 to 40
Like unchecked exceptions, errors are not checked at compile-time and are not usually thrown from application code.
Unlike exceptions, Errors represent serious system-level problems that applications should generally not attempt to catch or handle.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion to emphasize the difference between unchecked exceptions and errors.

Suggested change
Like unchecked exceptions, errors are not checked at compile-time and are not usually thrown from application code.
Unlike exceptions, Errors represent serious system-level problems that applications should generally not attempt to catch or handle.
Like unchecked exceptions, errors are not checked at compile-time.
The difference is that they represent system level problems and are generally thrown by the Java Virtual machine or environment instead of the application.
Applications should generally not attempt to catch or handle them.

@kahgoh
Copy link
Member

kahgoh commented Jun 15, 2025

I notice the markdown linting is failing on a file you haven't changed. This can be fixed by merging the latest changes from the main branch.

@BahaaMohamed98
Copy link
Contributor Author

Hi @kahgoh!

I’ve made the changes - You might want to review the wording in the first commit.
Should I update the other related files now, or leave that for later?

And should I add myself as a contributor?

@jagdish-15
Copy link
Contributor

And should I add myself as a contributor?

Yes, you’ve earned it!

@kahgoh
Copy link
Member

kahgoh commented Jun 16, 2025

Thanks @BahaaMohamed98, the updates to the introduction.md look good. Could you go ahead and update the other files to match?

@BahaaMohamed98
Copy link
Contributor Author

Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants