-
Notifications
You must be signed in to change notification settings - Fork 10
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
EZP-24851: CAPI to display server provided error message if it is sent #76
base: master
Are you sure you want to change the base?
Conversation
cool :) |
ping @dpobel this is about to become part of customer request (issue). |
This change is not really needed because even in case of error we always provide the response object where the error message is available (like any element in the response). So basically, in your callback you can always write something like: contentService.loadLocation(locationId, function (error, response) {
if ( error ) {
console.log(response.document.errorMessage.errorDescription);
}
}); |
but isn't something ala what proposed here about making sure it always displays in the dev toolbar? |
@andrerom not sure to fully understand your comment. What is "the dev toolbar" ? As far as I know, the CAPIError message is not really used any where. |
network tab in browser developer tools, the only place to know what goes wrong with this next gen UI ;) |
The CAPI error message can pop up as a fallback. In this specific case when developer validating on server side, it fails and shows the standard error message - even though the response contains the errorDescription in JSON that could be displayed. |
ahah :) but the network tab only cares about the actual server response, not how we create an Error object and so on. So this patch does not change anything there.
where does that happen ? if it's in PlatformUI, this should be fixed there as choosing the error message from the Response (or building the message differently) over the one provided by the Error message is an app decision, not a REST Client decision. |
Partial fix for EZP-24851, attempts to set error message to server provided one - if it is set as described in https://jira.ez.no/browse/EZP-24853: