Improve exception thrown when classes can't compile to be more clear#33897
Closed
Daniel9z wants to merge 1 commit into
Closed
Improve exception thrown when classes can't compile to be more clear#33897Daniel9z wants to merge 1 commit into
Daniel9z wants to merge 1 commit into
Conversation
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D36606279 |
Base commit: 0ef73f2 |
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D36606279 |
Base commit: fd9c677 |
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D36606279 |
…33897) Summary: Pull Request resolved: #33897 Now the exception will display the class which caused the exception as well as helpful information as to why. We've seen this happen a bunch due and have been very confused by the error message. It turns out that this processor runs before the classes listed are compiled. This means that if there's a compile error (or a missing import) the user will only see that this processor crashed, and not the compile error. The additional information in the error is: `java.lang.RuntimeException: Could not load classes set in ReactModuleList.nativeModules. Check that they exist and are imported correctly on class: com.meta.x.y.ReactPackage` In this case, `com.meta.x.y.ReactPackage` is the class which needs to be fixed. Before, the error message made no mention of this class or the annotation. Changelog: [Internal] This will change the way the annotation processor crashes. It will throw a RuntimeException instead of a ClassCastException. Reviewed By: javache Differential Revision: D36606279 fbshipit-source-id: 957f20b5aa396c7d3953b6780c62e4e5857cf5e2
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D36606279 |
Collaborator
|
This pull request was successfully merged by @Daniel9z in a3e25b2. When will my fix make it into a release? | Upcoming Releases |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Now the exception will display the class which caused the exception as well as helpful information as to why.
We've seen this happen a bunch due and have been very confused by the error message. It turns out that this processor runs before the classes listed are compiled. This means that if there's a compile error (or a missing import) the user will only see that this processor crashed, and not the compile error.
The additional information in the error is:
java.lang.RuntimeException: Could not load classes set in ReactModuleList.nativeModules. Check that they exist and are imported correctly on class: com.meta.x.y.ReactPackageIn this case,
com.meta.x.y.ReactPackageis the class which needs to be fixed. Before, the error message made no mention of this class or the annotation.Changelog: [Internal] This will change the way the annotation processor crashes. It will throw a RuntimeException instead of a ClassCastException.
Differential Revision: D36606279