-
Notifications
You must be signed in to change notification settings - Fork 0
handle 400 search event errors Issue #57 #62
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
9124a03
handle 400 search event errors Issue #57
malvpatel ab45bd0
Merge remote-tracking branch 'origin/main' into handle_400_search_errors
malvpatel 909c5d0
Merge remote-tracking branch 'origin/main' into handle_400_search_errors
malvpatel 3a6831a
show alert instead of triggering fallback on 403 error for search eve…
malvpatel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like providing error feedback to the user. I'm inclined to accept this even though it does expose
some issues.
In theory the json message can be translated. This method requires that the structure of the message
(value occurs before key and both are quoted strings) doesn't change. It also requires that there is only
one message that can be returned with a matching structure. If either of those requirements are not met,
I expect
will not match anything and it looks like your code handles that case. That would lead to a missing
error message.
This means different feedback (UI) for the same issue depending on the language. IIRC the REST interface messages you are using are not currently translated. So this isn't an issue at the moment. It does create a
close coupling between a human readable (vs. machine readable) message generated from
the back end and the correct opertation of the classhelper popup. This will require some additional
care.
Please add a test to @BharathKanama test file. Have the test rigger an error that causes this code to
run and verify that the error message is displayed. You will probably need to log in as the demo user
and do a search expected to trigger the error.
One other area for translation is the use of:
This is a phrase and isn't as simple as translating a word. E.G. in some language this might have
to be expressed with a structure like "Value ${value} is not correct".
Adding the literal string:
Invalid value: ${value}to the translation template and then expanding theresult should work. But this is more complex than just single word translations which have been
used up to this point and exposes some aditional risk.
So I say keep this code as is for the time being.