ODataModel function metadataLoaded returns promise which doesn't react on the request response if failed
See original GitHub issueSAPUI5 1.38.18
this code doesn’t react on the XHR response:
this.getModel().metadataLoaded().then(
function(oSuccess) {
// do nothing
},
function(oError) {
});
I also tried catch - never worked.
Yes - I agree I can use metadataFailed event. However I don’t understand then why do we need this method if it returns the promise working only on a half.
Thank you!
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
What is the replacement for "metadataLoaded" in JSONModel?
Since 1.64 1, JSONModel returns a promise when loadData or dataLoaded is ... metadataLoaded() 2 , the promise here actually rejects if the...
Read more >ODataModel: catch error when metadata failed
Hello, When an OData model is declared in the manifest and so initialized by ... metadataLoaded() promise does not resolve in case of...
Read more >sap.ui.model.odata.v2.ODataModel - API Reference - Demo Kit
If the POST request succeeds but the GET request for the navigation properties fails, the success handler is called with the data and...
Read more >sap.ui.model.odata.v2.ODataModel - OPENUI5 SDK
Trigger a request to the function import odata service that was specified in the ... metadataLoaded()Returns a promise for the loaded state of...
Read more >How to Handle Promises in React - Upmostly
To construct a Promise from scratch, you can use the Promise constructor. This takes a function which takes two parameters: “resolve”, a function...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is by design, the metadataLoaded promise does never fail, as described in the API documentation: “The promise won’t get rejected in case the metadata loading failed but is only resolved if the metadata is loaded successfully.”.
This is done this way to enable the possibility to retry loading the metadata and have it resolved later on.
thank you