-
-
Notifications
You must be signed in to change notification settings - Fork 493
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
3.12.x.error.message.editor.controller.after.metadata.remove #5946
3.12.x.error.message.editor.controller.after.metadata.remove #5946
Conversation
@wangf1122 can you indicate a test case to reproduce the problem? Does this happen with all exceptions returning an ApiError? I want to be sure the code change can't affect other code potentially returning the error in |
This is for our customized event listener exception throwing which I made another PR #5945. So I don't know if there is legit case to test in plain vanilla version. I could also change the code to check the original data.error if it's null or not. If it's null use my code otherwise remain as is. Do you think it's safer? For example var myError = (data.error == null)? data.message: data.error.message; Then use myError as the file error pass into Angular popup box. So it will be a safety check. I will push that code shortly and you will see it. |
I had put exception throwing as part of the API at my local The GlobalExceptionController.java caught it as return as APIError. Then the spinning button will hang forever. I can confirm this issue happens in 3.12.x branch. But it does not happen in main (4.x). I wonder what causes the difference and can we bring any change backport to 4.x? I suspect the code change in 4.x branch as core-geonetwork/web-ui/src/main/resources/catalog/js/edit/EditorBoardController.js Lines 121 to 125 in 2208161
It uses reason.data.description without the error which avoid causing such problem. It was part of this commit Wondering if we can backport this commit into 3.12.x ? I found this file is not changed as what the "EditorBoardController.js" you did. Do you think it should use same response standard as "reason.data.xxxxx" as well because that reason.data.error seems to be broken. core-geonetwork/web-ui/src/main/resources/catalog/js/edit/EditorController.js Lines 572 to 577 in 2208161
|
Close as duplicated from this PR #6029. |
The reason.data.error is not a valid according to ApiError class/JSON.
core-geonetwork/services/src/main/java/org/fao/geonet/api/ApiError.java
Line 36 in d4ace21
Here is what the response JSON looks like:
So the HTTP500 will not be recognized in the popup error window. The simple fix I propose is to do "reason.data.message" instead.