-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Closed
Copy link
Labels
Description
What is the issue and how can we reproduce it?
- Create a new controller via Controller.create, provide a controller that does not exist or contains errors
- Provide a catch function for the Controller.create Promise
- Run the code --> Issue: The catch function is not executed
Error:
If the controller can not be loaded, the catch function is not executed and we don't have a chance to provide a fallback.
Expected behavior:
The catch function of the promise is executed.
Reason:
The reject function is not returned for the promise in function loadControllerClass:
openui5/src/sap.ui.core/src/sap/ui/core/mvc/Controller.js
Lines 284 to 292 in 1cb704b
| return new Promise(function(resolve, reject) { | |
| if (!ControllerClass) { | |
| sap.ui.require([sControllerName], function (ControllerClass) { | |
| resolve(resolveClass(ControllerClass)); | |
| }); | |
| } else { | |
| resolve(ControllerClass); | |
| } | |
| }); |
In ui5 version 1.108 the reject function is returned:
openui5/src/sap.ui.core/src/sap/ui/core/mvc/Controller.js
Lines 290 to 298 in b90e963
| return new Promise(function(resolve, reject) { | |
| if (!ControllerClass) { | |
| sap.ui.require([sControllerName], function (ControllerClass) { | |
| resolve(resolveClass(ControllerClass)); | |
| }, reject); | |
| } else { | |
| resolve(ControllerClass); | |
| } | |
| }); |
Which OpenUI5 version is your project targeting?
1.71
Is the issue device- or browser-specific?
No response
Confirmation
- I have searched the existing issues and reviewed the relevant documentation as well as the API reference.
- I am not disclosing any internal or sensitive information.