Skip to content

sap.ui.core.mvc.Controller.create - missing reject in Promise (UI5 Version 1.71) #4356

@uifivvy

Description

@uifivvy

What is the issue and how can we reproduce it?

  1. Create a new controller via Controller.create, provide a controller that does not exist or contains errors
  2. Provide a catch function for the Controller.create Promise
  3. 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:

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:

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions