@sapui5/sap.ushell_abap 1.139.0 → 1.141.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/package.json +2 -2
  2. package/src/main/js/sap/ushell_abap/.library +1 -1
  3. package/src/main/js/sap/ushell_abap/adapters/abap/AdapterContainer.js +19 -13
  4. package/src/main/js/sap/ushell_abap/adapters/abap/AppStateAdapter.js +11 -11
  5. package/src/main/js/sap/ushell_abap/adapters/abap/ClientSideTargetResolutionAdapter.js +81 -81
  6. package/src/main/js/sap/ushell_abap/adapters/abap/CommonDataModelAdapter.js +1 -1
  7. package/src/main/js/sap/ushell_abap/adapters/abap/ConfigurationDefaultsAdapter.js +1 -2
  8. package/src/main/js/sap/ushell_abap/adapters/abap/ContainerAdapter.js +15 -17
  9. package/src/main/js/sap/ushell_abap/adapters/abap/FlpLaunchPageAdapter.js +230 -167
  10. package/src/main/js/sap/ushell_abap/adapters/abap/LaunchPageAdapter.js +1 -1
  11. package/src/main/js/sap/ushell_abap/adapters/abap/MenuAdapter.js +1 -1
  12. package/src/main/js/sap/ushell_abap/adapters/abap/NavTargetResolutionAdapter.js +1 -1
  13. package/src/main/js/sap/ushell_abap/adapters/abap/NavTargetResolutionInternalAdapter.js +1 -1
  14. package/src/main/js/sap/ushell_abap/adapters/abap/PageBuildingAdapter.js +10 -12
  15. package/src/main/js/sap/ushell_abap/adapters/abap/PagePersistenceAdapter.js +20 -17
  16. package/src/main/js/sap/ushell_abap/adapters/abap/PersonalizationAdapter.js +5 -5
  17. package/src/main/js/sap/ushell_abap/adapters/abap/PersonalizationV2Adapter.js +1 -1
  18. package/src/main/js/sap/ushell_abap/adapters/abap/SearchAdapter.js +1 -1
  19. package/src/main/js/sap/ushell_abap/adapters/abap/SupportTicketAdapter.js +2 -2
  20. package/src/main/js/sap/ushell_abap/adapters/abap/Ui5ComponentLoaderAdapter.js +1 -1
  21. package/src/main/js/sap/ushell_abap/adapters/abap/UserInfoAdapter.js +34 -28
  22. package/src/main/js/sap/ushell_abap/adapters/hana/ContainerAdapter.js +1 -1
  23. package/src/main/js/sap/ushell_abap/bootstrap/evo/SAPCompanionConditionSetter.js +5 -5
  24. package/src/main/js/sap/ushell_abap/bootstrap/evo/XhrLogonEventHandler.js +5 -2
  25. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.bootstrap.utils.js +2 -2
  26. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.configure.ushell.js +1 -1
  27. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.request.pageset.js +54 -31
  28. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.request.startup.js +17 -13
  29. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.theme.handler.js +2 -1
  30. package/src/main/js/sap/ushell_abap/bootstrap/evo/boottask.js +85 -74
  31. package/src/main/js/sap/ushell_abap/components/TCodeNavigation/MessageCode.js +47 -0
  32. package/src/main/js/sap/ushell_abap/components/TCodeNavigation/TCodeNavigationError.js +59 -0
  33. package/src/main/js/sap/ushell_abap/components/TCodeNavigation.js +163 -0
  34. package/src/main/js/sap/ushell_abap/integration/fileshares/AppRuntimeFileShareSupport.js +4 -4
  35. package/src/main/js/sap/ushell_abap/library.js +8 -1
  36. package/src/main/js/sap/ushell_abap/pbServices/ui2/AllCatalogs.js +2 -2
  37. package/src/main/js/sap/ushell_abap/pbServices/ui2/Bag.js +15 -19
  38. package/src/main/js/sap/ushell_abap/pbServices/ui2/Catalog.js +19 -17
  39. package/src/main/js/sap/ushell_abap/pbServices/ui2/Chip.js +14 -23
  40. package/src/main/js/sap/ushell_abap/pbServices/ui2/ChipDefinition.js +4 -5
  41. package/src/main/js/sap/ushell_abap/pbServices/ui2/ChipInstance.js +8 -13
  42. package/src/main/js/sap/ushell_abap/pbServices/ui2/Error.js +2 -2
  43. package/src/main/js/sap/ushell_abap/pbServices/ui2/Factory.js +12 -20
  44. package/src/main/js/sap/ushell_abap/pbServices/ui2/ODataService.js +9 -12
  45. package/src/main/js/sap/ushell_abap/pbServices/ui2/ODataWrapper.js +45 -33
  46. package/src/main/js/sap/ushell_abap/pbServices/ui2/Page.js +3 -5
  47. package/src/main/js/sap/ushell_abap/pbServices/ui2/PageBuildingService.js +19 -22
  48. package/src/main/js/sap/ushell_abap/pbServices/ui2/PageSet.js +9 -10
  49. package/src/main/js/sap/ushell_abap/pbServices/ui2/RemoteCatalogService.js +2 -2
  50. package/src/main/js/sap/ushell_abap/pbServices/ui2/Utils.js +19 -69
  51. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/actions.js +3 -4
  52. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/configuration.js +1 -1
  53. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/visible.js +2 -2
  54. package/src/main/js/sap/ushell_abap/ui5appruntime/AppInfoAdapter.js +2 -2
  55. package/ui5.yaml +33 -1
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * @fileoverview The Unified Shell's page building adapter for the ABAP platform. Private copy. Classical home page functions are deprecated.
5
5
  * @since 1.121
6
- * @version 1.139.0
6
+ * @version 1.141.0
7
7
  */
8
8
  sap.ui.define([
9
9
  "sap/ui/thirdparty/URI",
@@ -22,7 +22,8 @@ sap.ui.define([
22
22
  "sap/ushell/ui/tile/StaticTile",
23
23
  "sap/ushell/utils",
24
24
  "sap/ushell_abap/pbServices/ui2/contracts/preview",
25
- "sap/ushell/Container"
25
+ "sap/ushell/Container",
26
+ "sap/ushell/utils/LaunchpadError"
26
27
  ], (
27
28
  URI,
28
29
  ManifestPropertyHelper,
@@ -40,7 +41,8 @@ sap.ui.define([
40
41
  StaticTile,
41
42
  ushellUtils,
42
43
  Preview,
43
- Container
44
+ Container,
45
+ LaunchpadError
44
46
  ) => {
45
47
  "use strict";
46
48
 
@@ -78,7 +80,7 @@ sap.ui.define([
78
80
  * @since 1.121.0
79
81
  * @private
80
82
  */
81
- const LaunchPageAdapter = function (oUnused, sParameter, oAdapterConfiguration) {
83
+ function LaunchPageAdapter (oUnused, sParameter, oAdapterConfiguration) {
82
84
  let bCatalogsValid; // undefined = not yet valid
83
85
  let oGetGroupsDeferred; // used to synchronize parallel getGroups-requests
84
86
  let oGetCatalogsDeferred; // used to synchronize parallel getCatalog-requests
@@ -110,14 +112,14 @@ sap.ui.define([
110
112
  function getImplementationAsSapui5 (oTile, sTitle, sMessage) {
111
113
  try {
112
114
  return oTile.getImplementationAsSapui5();
113
- } catch (ex) {
115
+ } catch (oError) {
114
116
  // log errors, but do not fail
115
- Log.error(`${sMessage}: ${ex.message || ex}`, ex.stack, sCOMPONENT);
117
+ Log.error(sMessage, oError, sCOMPONENT);
116
118
  return new StaticTile({
117
119
  icon: "sap-icon://error",
118
120
  info: "",
119
121
  infoState: "Critical",
120
- subtitle: ex.message || ex,
122
+ subtitle: oError.message || oError,
121
123
  title: sTitle
122
124
  }).addStyleClass("sapUshellTileError");
123
125
  }
@@ -167,7 +169,7 @@ sap.ui.define([
167
169
  try {
168
170
  sTileConfig = oChip.getConfigurationParameter(sConfigParameterId);
169
171
  oTileConfig = JSON.parse(sTileConfig);
170
- } catch (e) {
172
+ } catch {
171
173
  // most likely this is not a static or dynamic applauncher
172
174
  return undefined;
173
175
  }
@@ -188,6 +190,8 @@ sap.ui.define([
188
190
  *
189
191
  * @param {object} [oConfiguration] object containing an order array, example: {order: ["id1", "id2", "id3"]}
190
192
  * @param {object[]} aElements array of objects. Each object must provide a getId method
193
+ *
194
+ * @returns {object[]} array of elements ordered according to the configuration
191
195
  * @private
192
196
  * @since 1.11.0
193
197
  * @deprecated since 1.120
@@ -226,6 +230,24 @@ sap.ui.define([
226
230
  return aOrderedElements;
227
231
  };
228
232
 
233
+ /**
234
+ * Removes vValue from the given array.
235
+ *
236
+ * @param {Array<*>} aArray The array from which the value should be removed from.
237
+ * @param {any} vValue The value to be removed.
238
+ * @returns {int} The index of the vValue in the array or -1 if it was not found.
239
+ * @private
240
+ * @deprecated since 1.120
241
+ */
242
+ function removeFromArray (aArray, vValue) {
243
+ const iSourceIndex = aArray.indexOf(vValue);
244
+ if (iSourceIndex < 0) {
245
+ return iSourceIndex;
246
+ }
247
+ aArray.splice(iSourceIndex, 1);
248
+ return iSourceIndex;
249
+ }
250
+
229
251
  /**
230
252
  * Removes the given tile from the given Page layout, according to it's current type.
231
253
  *
@@ -249,24 +271,6 @@ sap.ui.define([
249
271
  return removeFromArray(oLayout.order, oTile.getId());
250
272
  }
251
273
 
252
- /**
253
- * Removes vValue from the given array.
254
- *
255
- * @param {Array<*>} aArray The array from which the value should be removed from.
256
- * @param {any} vValue The value to be removed.
257
- * @returns {int} The index of the vValue in the array or -1 if it was not found.
258
- * @private
259
- * @deprecated since 1.120
260
- */
261
- function removeFromArray (aArray, vValue) {
262
- const iSourceIndex = aArray.indexOf(vValue);
263
- if (iSourceIndex < 0) {
264
- return iSourceIndex;
265
- }
266
- aArray.splice(iSourceIndex, 1);
267
- return iSourceIndex;
268
- }
269
-
270
274
  /**
271
275
  * Adds the given tile ID to the given Page layout in the specified index and according to it's current type.
272
276
  *
@@ -332,7 +336,7 @@ sap.ui.define([
332
336
  /**
333
337
  * Orders the pages of _oCurrentPageSet based on the configuration maintained in _oCurrentPageSet and returns the result.
334
338
  *
335
- * @returns {sap.ushell_abap.pbServices.ui2.Page[]}
339
+ * @returns {sap.ushell_abap.pbServices.ui2.Page[]} Returns a UI2 Page
336
340
  * @private
337
341
  * @deprecated since 1.120
338
342
  */
@@ -343,7 +347,7 @@ sap.ui.define([
343
347
  try {
344
348
  oConfiguration = JSON.parse(that._oCurrentPageSet.getConfiguration());
345
349
  oConfiguration.order.splice(0, 0, that._oCurrentPageSet.getDefaultPage().getId());
346
- } catch (e) {
350
+ } catch {
347
351
  oConfiguration = { order: [that._oCurrentPageSet.getDefaultPage().getId()] };
348
352
  }
349
353
  return LaunchPageAdapter.prototype._orderBasedOnConfiguration(oConfiguration, that._oCurrentPageSet.getPages());
@@ -364,15 +368,19 @@ sap.ui.define([
364
368
  const oDeferred = new jQuery.Deferred();
365
369
 
366
370
  if (!aHiddenGroupsIDs || !(aHiddenGroupsIDs instanceof Array)) {
367
- oDeferred.reject("Input parameter must be of type Array.");
371
+ oDeferred.reject(new Error("Input parameter must be of type Array."));
368
372
  } else {
369
373
  const oConf = JSON.parse(that._oCurrentPageSet.getConfiguration() || "{}");
370
374
 
371
375
  // Replace the hidden groups array on the current configuration with the new hidden groups array
372
376
  oConf.hiddenGroups = aHiddenGroupsIDs;
373
- that._oCurrentPageSet.setConfiguration(JSON.stringify(oConf),
374
- /* fnSuccess */oDeferred.resolve.bind(oDeferred),
375
- /* fnFailure */oDeferred.reject.bind(oDeferred));
377
+ that._oCurrentPageSet.setConfiguration(
378
+ JSON.stringify(oConf),
379
+ /* fnSuccess */oDeferred.resolve.bind(oDeferred),
380
+ /* fnFailure */(sErrorMessage) => {
381
+ oDeferred.reject(new Error(sErrorMessage));
382
+ }
383
+ );
376
384
  }
377
385
  return oDeferred.promise();
378
386
  };
@@ -414,6 +422,7 @@ sap.ui.define([
414
422
  * Triggers loading of a CHIP instance and adds the temporary property $loadingPromise to it
415
423
  * as it does not wait for the loading success or failure.
416
424
  * As soon as it is completely loaded (or loading failed) the $loadingPromise property is removed again.
425
+ * @param {object} oChipInstance the CHIP instance to be loaded
417
426
  * @deprecated since 1.120
418
427
  */
419
428
  LaunchPageAdapter.prototype._triggerChipInstanceLoad = function (oChipInstance) {
@@ -425,11 +434,11 @@ sap.ui.define([
425
434
  delete oChipInstance.$loadingPromise; // was temporarily needed only
426
435
  }
427
436
 
428
- function fnFailure (sMessage) {
437
+ function fnFailure (sErrorMessage) {
429
438
  // log errors, but do not fail
430
- Log.error(`Failed to load tile: ${sMessage}`, oChipInstance.toString(), sCOMPONENT);
439
+ Log.error(`Failed to load tile '${oChipInstance.toString()}': ${sErrorMessage}`, null, sCOMPONENT);
431
440
  if (oChipInstance._loadingDeferred) {
432
- oChipInstance._loadingDeferred.reject();
441
+ oChipInstance._loadingDeferred.reject(new Error(sErrorMessage));
433
442
  }
434
443
  delete oChipInstance._loadingDeferred;
435
444
  delete oChipInstance.$loadingPromise; // was temporarily needed only
@@ -438,6 +447,49 @@ sap.ui.define([
438
447
  oChipInstance.load(fnSuccess, fnFailure);
439
448
  };
440
449
 
450
+ /**
451
+ * Tells whether the given CHIP instance is a static or dynamic app launcher
452
+ * @param {sap.ushell_abap.pbServices.ui2.ChipInstance} oChipInstance the chip instance
453
+ * @returns {boolean} true if the CHIP instance is an app launcher, false otherwise
454
+ */
455
+ function isAppLauncher (oChipInstance) {
456
+ const sBaseChipId = oChipInstance.getChip().getBaseChipId();
457
+ return sBaseChipId === sDYNAMIC_BASE_CHIP_ID || sBaseChipId === sSTATIC_BASE_CHIP_ID;
458
+ }
459
+
460
+ /**
461
+ * Tells whether the given CHIP instance is a card
462
+ * @param {sap.ushell_abap.pbServices.ui2.ChipInstance} oChipInstance the chip instance
463
+ * @returns {boolean} true if the CHIP instance is a card, false otherwise
464
+ */
465
+ function isCard (oChipInstance) {
466
+ const sBaseChipId = oChipInstance.getChip().getBaseChipId();
467
+ return S_CARD_BASE_CHIP_ID === sBaseChipId;
468
+ }
469
+
470
+ /**
471
+ * Tells whether the given CHIP instance is remote
472
+ * @param {sap.ushell_abap.pbServices.ui2.ChipInstance} oChipInstance the chip instance
473
+ * @returns {boolean} true if the CHIP instance is remote, false otherwise
474
+ */
475
+ function isRemoteChipInstance (oChipInstance) {
476
+ return !!oChipInstance.getChip().getRemoteCatalog();
477
+ }
478
+
479
+ /**
480
+ * Tells whether the given CHIP instance is not loadable.
481
+ * This means it's data from the OData Service could not be loaded.
482
+ *
483
+ * Note: If this method returns false does not mean that the later loading will not fail
484
+ *
485
+ * @param {sap.ushell_abap.pbServices.ui2.ChipInstance} oChipInstance the chip instance
486
+ * @returns {boolean} true if the CHIP instance is not loadable, false otherwise
487
+ */
488
+ function isBrokenChip (oChipInstance) {
489
+ // alternative: !oChipInstance.getChip().isInitiallyDefined();
490
+ return !isRemoteChipInstance(oChipInstance) && oChipInstance.getChip().getBaseChipId() === undefined;
491
+ }
492
+
441
493
  /**
442
494
  * Triggers loading of all ChipInstances of the given pages and calls fnLocalChipsLoaded
443
495
  * when all local CHIP instances are completely loaded.
@@ -462,6 +514,7 @@ sap.ui.define([
462
514
  /**
463
515
  * Loads dependent libraries (core-ext-light for custom tiles and custom remote tiles)
464
516
  * and triggers the loading of the chip instances.
517
+ * @param {object} oChipInstance the CHIP instance to be loaded
465
518
  */
466
519
  function loadDependenciesAndTriggerChipInstanceLoad (oChipInstance) {
467
520
  // append the promise for loading to the instance, but only as long as loading is
@@ -500,6 +553,7 @@ sap.ui.define([
500
553
 
501
554
  /**
502
555
  * loads a CHIP instance and triggers finalize() or reject afterwards
556
+ * @param {object} oChipInstance the CHIP instance to be loaded
503
557
  */
504
558
  function loadChipInstance (oChipInstance) {
505
559
  function onLoad () {
@@ -577,12 +631,14 @@ sap.ui.define([
577
631
  }
578
632
 
579
633
  if (ObjectPath.get("compactTMPromise", oAdapterConfig)) {
580
- oAdapterConfig.compactTMPromise.then((oResult) => {
581
- const aRes = formatResult(oResult || {});
582
- oDeferred.resolve({ results: aRes });
583
- }, (sFail) => {
584
- oDeferred.reject(sFail);
585
- });
634
+ oAdapterConfig.compactTMPromise
635
+ .then((oResult) => {
636
+ const aRes = formatResult(oResult || {});
637
+ oDeferred.resolve({ results: aRes });
638
+ })
639
+ .catch((oError) => {
640
+ oDeferred.reject(oError);
641
+ });
586
642
  return oDeferred.promise();
587
643
  }
588
644
  const oTargetMappingsConfig = ObjectPath.create("services.targetMappings", oAdapterConfig);
@@ -606,8 +662,8 @@ sap.ui.define([
606
662
  const aRes = formatResult(oDirectStartTargetMappings);
607
663
  oDeferred.resolve({ results: aRes });
608
664
  },
609
- (sMessage) => {
610
- oDeferred.reject(sMessage);
665
+ (sErrorMessage) => {
666
+ oDeferred.reject(new Error(sErrorMessage));
611
667
  }
612
668
  );
613
669
  return oDeferred.promise();
@@ -630,8 +686,8 @@ sap.ui.define([
630
686
  * This is the case for the results of {@link #addTile}, but not for {@link #addBookmark}.
631
687
  * Such wrappers must be unwrapped by {@link #moveTile} or else the title becomes "hard coded" in the newly created CHIP instance.
632
688
  *
633
- * @param {sap.ushell_abap.pbServices.ui2.ChipInstance} oTile
634
- * @returns {boolean}
689
+ * @param {sap.ushell_abap.pbServices.ui2.ChipInstance} oTile the tile object
690
+ * @returns {boolean} true if the tile has a config
635
691
  * @deprecated since 1.120
636
692
  */
637
693
  LaunchPageAdapter.prototype._isWrapperOnly = function (oTile) {
@@ -700,49 +756,6 @@ sap.ui.define([
700
756
  return aWrappedCatalogs;
701
757
  }
702
758
 
703
- /**
704
- * Tells whether the given CHIP instance is a static or dynamic app launcher
705
- * @param {sap.ushell_abap.pbServices.ui2.ChipInstance} oChipInstance
706
- * @returns {boolean}
707
- */
708
- function isAppLauncher (oChipInstance) {
709
- const sBaseChipId = oChipInstance.getChip().getBaseChipId();
710
- return sBaseChipId === sDYNAMIC_BASE_CHIP_ID || sBaseChipId === sSTATIC_BASE_CHIP_ID;
711
- }
712
-
713
- /**
714
- * Tells whether the given CHIP instance is a card
715
- * @param {sap.ushell_abap.pbServices.ui2.ChipInstance} oChipInstance
716
- * @returns {boolean}
717
- */
718
- function isCard (oChipInstance) {
719
- const sBaseChipId = oChipInstance.getChip().getBaseChipId();
720
- return S_CARD_BASE_CHIP_ID === sBaseChipId;
721
- }
722
-
723
- /**
724
- * Tells whether the given CHIP instance is remote
725
- * @param {sap.ushell_abap.pbServices.ui2.ChipInstance} oChipInstance
726
- * @returns {boolean}
727
- */
728
- function isRemoteChipInstance (oChipInstance) {
729
- return !!oChipInstance.getChip().getRemoteCatalog();
730
- }
731
-
732
- /**
733
- * Tells whether the given CHIP instance is not loadable.
734
- * This means it's data from the OData Service could not be loaded.
735
- *
736
- * Note: If this method returns false does not mean that the later loading will not fail
737
- *
738
- * @param {sap.ushell_abap.pbServices.ui2.ChipInstance} oChipInstance
739
- * @returns {boolean}
740
- */
741
- function isBrokenChip (oChipInstance) {
742
- // alternative: !oChipInstance.getChip().isInitiallyDefined();
743
- return !isRemoteChipInstance(oChipInstance) && oChipInstance.getChip().getBaseChipId() === undefined;
744
- }
745
-
746
759
  /**
747
760
  * Returns the tile configuration of the given (app launcher) CHIP instance.
748
761
  * It logs an error message if the tile configuration cannot be parsed.
@@ -755,11 +768,11 @@ sap.ui.define([
755
768
  const sConfigParam = oChipInstance.getConfigurationParameter("tileConfiguration");
756
769
  try {
757
770
  oParsedTileConfiguration = JSON.parse(sConfigParam || "{}");
758
- } catch (oEx) {
771
+ } catch (oError) {
759
772
  Log.error(`Tile with ID '${oChipInstance.getId()
760
773
  }' has a corrupt configuration containing a 'tileConfiguration' value '${sConfigParam
761
774
  }' which could not be parsed. If present, a (stringified) JSON is expected as value.`,
762
- oEx.message,
775
+ oError,
763
776
  "sap.ushell_abap.adapters.abap.LaunchPageAdapter"
764
777
  );
765
778
  return {}; // the FLP must react robust on broken single tiles
@@ -794,7 +807,7 @@ sap.ui.define([
794
807
  oAppLauncherStyleConfig.navigation_semantic_object = oParsedTileProperties.semanticObject;
795
808
  oAppLauncherStyleConfig.navigation_semantic_action = oParsedTileProperties.semanticAction;
796
809
  }
797
- } catch (oEx) {
810
+ } catch (oError) {
798
811
  // it is fine if a tile is not sticking to the expected configuration structure
799
812
  return {};
800
813
  }
@@ -846,7 +859,7 @@ sap.ui.define([
846
859
  // Drawback: Configuration defaults (which are usually not used in Fiori) from CHIP definition XML are ignored here.
847
860
  const oConfigParam = JSON.parse(oChipInstance.getChip()._getChipRawConfigurationString());
848
861
  oParsedTileConfiguration = JSON.parse(oConfigParam && oConfigParam.tileConfiguration || "{}");
849
- } catch (oEx) {
862
+ } catch (oError) {
850
863
  // Custom tiles may or may not stick to the app launcher's configuration format
851
864
  return {};
852
865
  }
@@ -920,7 +933,7 @@ sap.ui.define([
920
933
  * @private
921
934
  */
922
935
  this._parseReferenceLost = function (sReferenceLost) {
923
- var sReferenceLostSafe = sReferenceLost || Object.prototype.toString.apply(sReferenceLostSafe);
936
+ const sReferenceLostSafe = sReferenceLost || "";
924
937
 
925
938
  if (!sReferenceLostSafe.match(/^Reference lost: Note \d+ Page.+\s,\sInstance ID.+$/)) {
926
939
  Log.warning(
@@ -1078,7 +1091,7 @@ sap.ui.define([
1078
1091
  });
1079
1092
  break;
1080
1093
  case O_ERROR_TYPES.emptyConfiguration:
1081
- var sRawTileConfiguration = oChipInstance.getConfigurationParameter("tileConfiguration");
1094
+ const sRawTileConfiguration = oChipInstance.getConfigurationParameter("tileConfiguration");
1082
1095
  aResult.push({
1083
1096
  type: O_ERROR_TYPES.emptyConfiguration,
1084
1097
  chipInstanceId: oChipInstance.getId(),
@@ -1113,6 +1126,7 @@ sap.ui.define([
1113
1126
  * Formats information about one error into a string.
1114
1127
  *
1115
1128
  * @param {object} oTileError An object representing tile errors
1129
+ * @returns {string} A string describing the error
1116
1130
  */
1117
1131
  this._formatTileError = function (oTileError) {
1118
1132
  switch (oTileError.type) {
@@ -1438,8 +1452,8 @@ sap.ui.define([
1438
1452
 
1439
1453
  try {
1440
1454
  oLayout = JSON.parse(oGroup.getLayout());
1441
- } catch (e) {
1442
- Log.warning(`Group ${oGroup.getId()}: invalid layout: ${oGroup.getLayout()}`, null, sCOMPONENT);
1455
+ } catch (oError) {
1456
+ Log.warning(`Group ${oGroup.getId()}: invalid layout: ${oGroup.getLayout()}`, oError, sCOMPONENT);
1443
1457
  // no valid layout
1444
1458
  }
1445
1459
  return this._orderBasedOnConfiguration(oLayout, oGroup.getChipInstances());
@@ -1490,7 +1504,9 @@ sap.ui.define([
1490
1504
 
1491
1505
  that._oCurrentPageSet.appendPage(sTitle, sDEFAULT_CATALOG_ID,
1492
1506
  oDeferred.resolve.bind(oDeferred),
1493
- oDeferred.reject.bind(oDeferred, getOrderedPages()));
1507
+ (sErrorMessage) => {
1508
+ oDeferred.reject(new Error(sErrorMessage), getOrderedPages());
1509
+ });
1494
1510
 
1495
1511
  return oDeferred.promise();
1496
1512
  };
@@ -1509,10 +1525,16 @@ sap.ui.define([
1509
1525
  const oDeferred = new jQuery.Deferred();
1510
1526
 
1511
1527
  if (that._oCurrentPageSet.isPageRemovable(oGroup)) {
1512
- that._oCurrentPageSet.removePage(oGroup, oDeferred.resolve.bind(oDeferred),
1513
- oDeferred.reject.bind(oDeferred, getOrderedPages()));
1528
+ that._oCurrentPageSet.removePage(
1529
+ oGroup,
1530
+ oDeferred.resolve.bind(oDeferred),
1531
+ (sErrorMessage) => {
1532
+ Log.error(`Failed to remove group '${oGroup.toString()}'`, sErrorMessage, sCOMPONENT);
1533
+ oDeferred.reject(new Error(sErrorMessage), getOrderedPages());
1534
+ }
1535
+ );
1514
1536
  } else {
1515
- oDeferred.reject(getOrderedPages());
1537
+ oDeferred.reject(new Error("Group is not removable"), getOrderedPages());
1516
1538
  }
1517
1539
  return oDeferred.promise();
1518
1540
  };
@@ -1534,12 +1556,17 @@ sap.ui.define([
1534
1556
 
1535
1557
  if (that._oCurrentPageSet.isPageRemovable(oGroup)) {
1536
1558
  // pages which are removable should be removed and cannot be reset
1537
- oDeferred.reject(getOrderedPages());
1559
+ oDeferred.reject(new Error("Group is not removable"), getOrderedPages());
1538
1560
  } else if (that._oCurrentPageSet.isPageResettable(oGroup)) {
1539
1561
  // pages which are resettable should be reset
1540
- that._oCurrentPageSet.resetPage(oGroup, () => {
1541
- that._loadApplaunchersAndDelayLoadingOfOtherChips([oGroup], oDeferred.resolve.bind(oDeferred, oGroup));
1542
- }, oDeferred.reject.bind(oDeferred, getOrderedPages()));
1562
+ that._oCurrentPageSet.resetPage(
1563
+ oGroup,
1564
+ () => {
1565
+ that._loadApplaunchersAndDelayLoadingOfOtherChips([oGroup], oDeferred.resolve.bind(oDeferred, oGroup));
1566
+ },
1567
+ (sErrorMessage) => {
1568
+ oDeferred.reject(new Error("Failed to reset group"), getOrderedPages());
1569
+ });
1543
1570
  } else {
1544
1571
  // on all other pages an reset has simply no effect
1545
1572
  oDeferred.resolve(oGroup);
@@ -1803,7 +1830,9 @@ sap.ui.define([
1803
1830
  oConf.order = aIds;
1804
1831
  that._oCurrentPageSet.setConfiguration(JSON.stringify(oConf),
1805
1832
  oDeferred.resolve.bind(oDeferred),
1806
- oDeferred.reject.bind(oDeferred, getOrderedPages()));
1833
+ (sErrorMessage) => {
1834
+ oDeferred.reject(new Error(sErrorMessage), getOrderedPages());
1835
+ });
1807
1836
  }
1808
1837
 
1809
1838
  this.getGroups().done((aPages) => {
@@ -1832,8 +1861,8 @@ sap.ui.define([
1832
1861
 
1833
1862
  oGroup.setTitle(sNewTitle,
1834
1863
  oDeferred.resolve.bind(oDeferred),
1835
- () => {
1836
- oDeferred.reject(oGroup.getTitle());
1864
+ (sErrorMessage) => {
1865
+ oDeferred.reject(new Error("Failed to set group title"), oGroup.getTitle());
1837
1866
  });
1838
1867
 
1839
1868
  return oDeferred.promise();
@@ -1856,7 +1885,7 @@ sap.ui.define([
1856
1885
  if (oCatalogTile.isStub()) {
1857
1886
  // this is a "Cannot load tile" tile, this should not be added to the group
1858
1887
  // BCP 1670300106
1859
- oDeferred.reject(getOrderedPages(), new Error("Tile was not added to the group as the tile failed loading"));
1888
+ oDeferred.reject(new Error("Tile was not added to the group as the tile failed loading"), getOrderedPages());
1860
1889
  } else {
1861
1890
  if (!oGroup) {
1862
1891
  oGroup = that._oCurrentPageSet.getDefaultPage();
@@ -1864,7 +1893,10 @@ sap.ui.define([
1864
1893
 
1865
1894
  oGroup.addChipInstance(oChip,
1866
1895
  oDeferred.resolve.bind(oDeferred),
1867
- oDeferred.reject.bind(oDeferred, getOrderedPages()));
1896
+ (sErrorMessage) => {
1897
+ oDeferred.reject(new Error(sErrorMessage), getOrderedPages());
1898
+ }
1899
+ );
1868
1900
  }
1869
1901
 
1870
1902
  return oDeferred.promise();
@@ -1885,7 +1917,10 @@ sap.ui.define([
1885
1917
 
1886
1918
  oGroup.removeChipInstance(oTile,
1887
1919
  oDeferred.resolve.bind(oDeferred),
1888
- oDeferred.reject.bind(oDeferred, getOrderedPages()));
1920
+ (sErrorMessage) => {
1921
+ oDeferred.reject(new Error(sErrorMessage), getOrderedPages());
1922
+ }
1923
+ );
1889
1924
  return oDeferred.promise();
1890
1925
  };
1891
1926
 
@@ -1909,7 +1944,9 @@ sap.ui.define([
1909
1944
  const bIsWrapperOnly = this._isWrapperOnly(oTile);
1910
1945
  const oBagsContents = new Utils.Map();
1911
1946
  let oCreatedChipInstance;
1912
- const fnFailure = oDeferred.reject.bind(oDeferred, getOrderedPages());
1947
+ function fnFailure (sErrorMessage) {
1948
+ oDeferred.reject(new Error(sErrorMessage), getOrderedPages());
1949
+ }
1913
1950
  let iCalls = 2;
1914
1951
 
1915
1952
  function resolveMoveBetweenGroups (oNewChipInstance) {
@@ -1934,7 +1971,7 @@ sap.ui.define([
1934
1971
  iSourceIndex = removeFromLayout(oSourceLayout, oTile, sOldTileType);
1935
1972
  if (iSourceIndex < 0) {
1936
1973
  Log.error("moveTile: tile not found in source group", null, sCOMPONENT);
1937
- fnFailure();
1974
+ fnFailure("moveTile: tile not found in source group");
1938
1975
  return oDeferred.promise();
1939
1976
  }
1940
1977
 
@@ -2041,8 +2078,8 @@ sap.ui.define([
2041
2078
  // Note: no verification if oTile.getChip().getAvailableTypes() contains "link" -> fail early in this case
2042
2079
  return "link";
2043
2080
  }
2044
- } catch (e) {
2045
- Log.warning(`Group ${oGroup.getId()}: invalid layout: ${oGroup.getLayout()}`, null, sCOMPONENT);
2081
+ } catch (oError) {
2082
+ Log.warning(`Group ${oGroup.getId()}: invalid layout: ${oGroup.getLayout()}`, oError, sCOMPONENT);
2046
2083
  }
2047
2084
 
2048
2085
  // Cards can never be a stub at this point
@@ -2072,8 +2109,8 @@ sap.ui.define([
2072
2109
  oManifest = ManifestPropertyHelper.mergeCardData(oManifest, oCardData);
2073
2110
 
2074
2111
  return oManifest;
2075
- } catch (error) {
2076
- Log.error(`Manifest of card with id '${card.getId()}' could not be read. ${error.message}`);
2112
+ } catch (oError) {
2113
+ Log.error(`Manifest of card with id '${card.getId()}' could not be read.`, oError);
2077
2114
  }
2078
2115
  };
2079
2116
 
@@ -2103,6 +2140,11 @@ sap.ui.define([
2103
2140
  const that = this;
2104
2141
  const oDeferred = new jQuery.Deferred();
2105
2142
 
2143
+ function doReject (oError) {
2144
+ Log.error("Tile not successfully loaded:", oError, sCOMPONENT);
2145
+ oDeferred.reject(oError);
2146
+ }
2147
+
2106
2148
  function doResolve () {
2107
2149
  let sTileType;
2108
2150
 
@@ -2145,10 +2187,6 @@ sap.ui.define([
2145
2187
  .catch(doReject);
2146
2188
  }
2147
2189
 
2148
- function doReject (sMessage) {
2149
- oDeferred.reject(`Tile not successfully loaded${sMessage ? (`: ${sMessage}`) : ""}`);
2150
- }
2151
-
2152
2190
  if (!oTile.$loadingPromise) { // loading resolved or failed
2153
2191
  if (!oTile.isStub()) { // success
2154
2192
  // call getImplementationAsSapui5Async async for non-AppLaunchers and resolves.
@@ -2157,7 +2195,7 @@ sap.ui.define([
2157
2195
  // Although they are called sync the view creation is still async
2158
2196
  Utils.callHandler(doResolve, doReject, /* async */!isAppLauncher(oTile));
2159
2197
  } else { // failed
2160
- doReject();
2198
+ doReject(new Error("Tile failed to load - tile is still a stub"));
2161
2199
  }
2162
2200
  } else { // loading pending
2163
2201
  oTile.$loadingPromise
@@ -2165,8 +2203,8 @@ sap.ui.define([
2165
2203
  .done(() => {
2166
2204
  try {
2167
2205
  doResolve();
2168
- } catch (ex) {
2169
- doReject((ex.message || ex));
2206
+ } catch (oError) {
2207
+ doReject((oError));
2170
2208
  }
2171
2209
  });
2172
2210
  }
@@ -2394,10 +2432,10 @@ sap.ui.define([
2394
2432
  if (iPendingRequests <= 0) {
2395
2433
  oDeferred.resolve(aWrappedCatalogs);
2396
2434
  }
2397
- }, (sMessage) => {
2435
+ }, (sErrorMessage) => {
2398
2436
  // log errors, but do not fail
2399
- Log.error(`Failed to load catalog: ${sMessage}`, oCatalog.toString(), sCOMPONENT);
2400
- oWrappedCatalog.errorMessage = sMessage || "Error"; // not undefined!
2437
+ Log.error(`Failed to load catalog: ${sErrorMessage}`, oCatalog.toString(), sCOMPONENT);
2438
+ oWrappedCatalog.errorMessage = sErrorMessage || "Error"; // not undefined!
2401
2439
 
2402
2440
  oDeferred.notify(oWrappedCatalog);
2403
2441
 
@@ -2450,7 +2488,9 @@ sap.ui.define([
2450
2488
  if (oAllCatalogs.isStub()) {
2451
2489
  oAllCatalogs.load(() => {
2452
2490
  this._refreshRemoteCatalogs(oDeferred);
2453
- }, oDeferred.reject, "type eq 'CATALOG_PAGE' or type eq 'H' or type eq 'SM_CATALOG' or type eq 'REMOTE'", true, "title", true);
2491
+ }, (sErrorMessage) => {
2492
+ oDeferred.reject(new Error(sErrorMessage));
2493
+ }, "type eq 'CATALOG_PAGE' or type eq 'H' or type eq 'SM_CATALOG' or type eq 'REMOTE'", true, "title", true);
2454
2494
  } else if (bRefreshRequired) {
2455
2495
  this._refreshRemoteCatalogs(oDeferred);
2456
2496
  } else {
@@ -2508,7 +2548,7 @@ sap.ui.define([
2508
2548
  * it might become <code>false</code> again in case one of the catalogs has been invalidated,
2509
2549
  * e.g. due to the addition of a tile ("Add to catalog" scenario).
2510
2550
  *
2511
- * @returns {boolean}
2551
+ * @returns {boolean} if the catalogs collection is still valid, <code>false</code> otherwise.
2512
2552
  * @since 1.16.4
2513
2553
  * @deprecated since 1.120
2514
2554
  * @see #getCatalogs
@@ -2588,9 +2628,9 @@ sap.ui.define([
2588
2628
  }
2589
2629
  }
2590
2630
 
2591
- function onFailure (oCatalogTile, sMessage) {
2631
+ function onFailure (oCatalogTile, sErrorMessage) {
2592
2632
  // log errors, but do not fail
2593
- Log.error(`Failed to load catalog tile: ${sMessage}`, oCatalogTile.toString(), sCOMPONENT);
2633
+ Log.error(`Failed to load catalog tile: ${sErrorMessage}`, oCatalogTile.toString(), sCOMPONENT);
2594
2634
  onLoaded();
2595
2635
  }
2596
2636
 
@@ -2921,13 +2961,11 @@ sap.ui.define([
2921
2961
 
2922
2962
  // Apply the 'search' contract when available
2923
2963
  function getKeywordsFromSearchContract (oCatalogTile) {
2924
- let oSearchContract;
2925
-
2926
2964
  if (oCatalogTile.isStub()) {
2927
2965
  return [];
2928
2966
  }
2929
2967
 
2930
- oSearchContract = oCatalogTile.getContract("search");
2968
+ const oSearchContract = oCatalogTile.getContract("search");
2931
2969
  if (oSearchContract) {
2932
2970
  return oSearchContract.getKeywords();
2933
2971
  }
@@ -3030,7 +3068,7 @@ sap.ui.define([
3030
3068
  if (oGroup && !(oGroup instanceof Page)) {
3031
3069
  // same behavior like addCatalogTileToGroup of the Bookmark service:
3032
3070
  // if the group is unknown don't use the default group but reject.
3033
- oDeferred.reject("The given object is not a group");
3071
+ oDeferred.reject(new Error("The given object is not a group"));
3034
3072
  return oDeferred.promise();
3035
3073
  }
3036
3074
 
@@ -3042,8 +3080,8 @@ sap.ui.define([
3042
3080
  .then(() => {
3043
3081
  oDeferred.resolve();
3044
3082
  })
3045
- .catch((vError) => {
3046
- oDeferred.reject(vError.toString());
3083
+ .catch((oError) => {
3084
+ oDeferred.reject(oError);
3047
3085
  });
3048
3086
  return oDeferred.promise();
3049
3087
  };
@@ -3092,7 +3130,7 @@ sap.ui.define([
3092
3130
  if (oGroup && !(oGroup instanceof Page)) {
3093
3131
  // same behavior like addCatalogTileToGroup of the Bookmark service:
3094
3132
  // if the group is unknown don't use the default group but reject.
3095
- oDeferred.reject("The given object is not a group");
3133
+ oDeferred.reject(new Error("The given object is not a group"));
3096
3134
  return oDeferred.promise();
3097
3135
  }
3098
3136
 
@@ -3100,8 +3138,8 @@ sap.ui.define([
3100
3138
  .then(() => {
3101
3139
  oDeferred.resolve();
3102
3140
  })
3103
- .catch((vError) => {
3104
- oDeferred.reject(vError.toString());
3141
+ .catch((oError) => {
3142
+ oDeferred.reject(oError);
3105
3143
  });
3106
3144
  return oDeferred.promise();
3107
3145
  };
@@ -3182,7 +3220,15 @@ sap.ui.define([
3182
3220
  aPromises.push(new Promise((resolve, reject) => {
3183
3221
  if (bBagUpdated) {
3184
3222
  aUpdatedBags.push(sBagId);
3185
- oBag.save(resolve, reject);
3223
+ oBag.save(resolve, (mErrorMessages, mErrorInfo) => {
3224
+ const sFirstFailedBag = Object.keys(mErrorMessages)[0];
3225
+
3226
+ reject(new LaunchpadError(`Bag save failed: ${mErrorMessages[sFirstFailedBag]}`, {
3227
+ info: mErrorInfo[sFirstFailedBag],
3228
+ otherMessages: mErrorMessages,
3229
+ otherInfo: mErrorInfo
3230
+ }));
3231
+ });
3186
3232
  } else {
3187
3233
  resolve();
3188
3234
  }
@@ -3221,9 +3267,9 @@ sap.ui.define([
3221
3267
  this.getTileSize(oChipInstance);
3222
3268
  resolve();
3223
3269
  } catch (oError) {
3224
- const sMessage = `Chip configuration check failed: ${oError.toString()}`;
3225
- Log.error(sMessage, oChipInstance.getId(), sCOMPONENT);
3226
- reject(sMessage);
3270
+ const sMessage = `Chip configuration check failed for '${oChipInstance.getId()}':`;
3271
+ Log.error(sMessage, oError, sCOMPONENT);
3272
+ reject(oError);
3227
3273
  }
3228
3274
  });
3229
3275
  };
@@ -3277,7 +3323,9 @@ sap.ui.define([
3277
3323
  // the create service does not support deep insert
3278
3324
  // Chip ChipBags -> Chip
3279
3325
  });
3280
- oGroup.addChipInstance(oChipInstance, resolve, reject, undefined);
3326
+ oGroup.addChipInstance(oChipInstance, resolve, (sErrorMessage) => {
3327
+ reject(new Error(sErrorMessage));
3328
+ }, undefined);
3281
3329
  } else {
3282
3330
  // This can happen in the app cold-start use case, when the app creates a bookmark
3283
3331
  // createPageChipInstanceFromRawData might throw Errors
@@ -3288,10 +3336,14 @@ sap.ui.define([
3288
3336
  pageId: "/UI2/Fiori2LaunchpadHome", // Default Page
3289
3337
  title: sTitle // the title is used for e.g. the message toast after deleting a bookmark
3290
3338
  }, (oRawChipInstance) => {
3291
- oFactory.createChipInstance(oRawChipInstance, resolve, reject, /* oPage */undefined);
3292
- }, reject);
3293
- } catch (vError) {
3294
- reject(vError);
3339
+ oFactory.createChipInstance(oRawChipInstance, resolve, (sErrorMessage) => {
3340
+ reject(new Error(sErrorMessage));
3341
+ }, /* oPage */undefined);
3342
+ }, (sErrorMessage) => {
3343
+ reject(new Error(sErrorMessage));
3344
+ });
3345
+ } catch (oError) {
3346
+ reject(oError);
3295
3347
  }
3296
3348
  }
3297
3349
  });
@@ -3301,9 +3353,9 @@ sap.ui.define([
3301
3353
  .then(() => {
3302
3354
  return this._checkBookmarkConfiguration(oChipInstance);
3303
3355
  })
3304
- .catch((vError) => {
3356
+ .catch((oError) => {
3305
3357
  return new Promise((resolve, reject) => {
3306
- oChipInstance.remove(reject.bind(undefined, vError), reject.bind(undefined, vError));
3358
+ oChipInstance.remove(reject.bind(undefined, oError), reject.bind(undefined, oError));
3307
3359
  });
3308
3360
  });
3309
3361
  });
@@ -3312,9 +3364,9 @@ sap.ui.define([
3312
3364
  /**
3313
3365
  * Tells whether the given CHIP instance represents a bookmark matching the given identifier.
3314
3366
  *
3315
- * @param {sap.ushell_abap.pbServices.ui2.ChipInstance} oChipInstance
3367
+ * @param {sap.ushell_abap.pbServices.ui2.ChipInstance} oChipInstance the CHIP instance to be checked
3316
3368
  * @param {string | object} vIdentifier the url as string or an identifier object
3317
- * @returns {boolean}
3369
+ * @returns {boolean} If the CHIP instance represents a bookmark matching the given identifier.
3318
3370
  * @see #addBookmark
3319
3371
  * @since 1.17.1
3320
3372
  * @deprecated since 1.120
@@ -3369,16 +3421,16 @@ sap.ui.define([
3369
3421
  oDeferred.resolve(iCount);
3370
3422
  } else {
3371
3423
  jQuery.when.apply(jQuery, aDeferreds)
3372
- .fail((sMessage) => {
3373
- oDeferred.reject(sMessage);
3424
+ .fail((oError) => {
3425
+ oDeferred.reject(oError);
3374
3426
  })
3375
3427
  .done(() => {
3376
3428
  oDeferred.resolve(iCount);
3377
3429
  });
3378
3430
  }
3379
3431
  })
3380
- .catch((vError) => {
3381
- oDeferred.reject(vError.message || vError);
3432
+ .catch((oError) => {
3433
+ oDeferred.reject(oError);
3382
3434
  });
3383
3435
  return oDeferred.promise();
3384
3436
  };
@@ -3402,9 +3454,9 @@ sap.ui.define([
3402
3454
  * @since 1.83.0
3403
3455
  * @deprecated since 1.120
3404
3456
  */
3405
- this._visitCustomBookmarks = function (oIdentifier, fnVisitor) {
3457
+ this._visitCustomBookmarks = async function (oIdentifier, fnVisitor) {
3406
3458
  if (!oIdentifier.chipId) {
3407
- return Promise.reject("_visitCustomBookmarks: Required parameter is missing: oIdentifier.chipId");
3459
+ throw new Error("_visitCustomBookmarks: Required parameter is missing: oIdentifier.chipId");
3408
3460
  }
3409
3461
  return new Promise((resolve, reject) => {
3410
3462
  this.getGroups()
@@ -3487,7 +3539,9 @@ sap.ui.define([
3487
3539
  return LaunchPageAdapter.prototype._visitBookmarks(sUrl, (oChipInstance) => {
3488
3540
  const oDeferred = new jQuery.Deferred();
3489
3541
  oChipInstance.remove(oDeferred.resolve.bind(oDeferred),
3490
- oDeferred.reject.bind(oDeferred));
3542
+ (sErrorMessage) => {
3543
+ oDeferred.reject(new Error(sErrorMessage));
3544
+ });
3491
3545
  return oDeferred.promise();
3492
3546
  });
3493
3547
  };
@@ -3515,7 +3569,9 @@ sap.ui.define([
3515
3569
  this.deleteCustomBookmarks = function (oIdentifier) {
3516
3570
  return this._visitCustomBookmarks(oIdentifier, (oChipInstance) => {
3517
3571
  return new Promise((resolve, reject) => {
3518
- oChipInstance.remove(resolve, reject);
3572
+ oChipInstance.remove(resolve, (sErrorMessage) => {
3573
+ reject(new Error(sErrorMessage));
3574
+ });
3519
3575
  });
3520
3576
  });
3521
3577
  };
@@ -3579,7 +3635,9 @@ sap.ui.define([
3579
3635
  })
3580
3636
  .then(() => {
3581
3637
  return new Promise((resolve, reject) => {
3582
- oChipInstance.updateConfiguration(oConfiguration, resolve, reject);
3638
+ oChipInstance.updateConfiguration(oConfiguration, resolve, (sErrorMessage) => {
3639
+ reject(new Error(sErrorMessage));
3640
+ });
3583
3641
  });
3584
3642
  })
3585
3643
  .then(() => {
@@ -3593,7 +3651,7 @@ sap.ui.define([
3593
3651
  oDeferred.resolve();
3594
3652
  })
3595
3653
  .catch((oError) => {
3596
- oDeferred.reject(oError.toString());
3654
+ oDeferred.reject(oError);
3597
3655
  });
3598
3656
 
3599
3657
  return oDeferred.promise();
@@ -3671,7 +3729,9 @@ sap.ui.define([
3671
3729
  return new Promise((resolve, reject) => {
3672
3730
  // chip might throw an error because of missing writeConfiguration contract
3673
3731
  try {
3674
- oChipInstance.updateConfiguration(oConfiguration, resolve, reject);
3732
+ oChipInstance.updateConfiguration(oConfiguration, resolve, (sErrorMessage) => {
3733
+ reject(new Error(sErrorMessage));
3734
+ });
3675
3735
  } catch (oError) {
3676
3736
  reject(oError);
3677
3737
  }
@@ -3690,7 +3750,9 @@ sap.ui.define([
3690
3750
  }
3691
3751
  return new Promise((resolve, reject) => {
3692
3752
  if (oBookmarkConfig.title) {
3693
- oChipInstance.setTitle(oBookmarkConfig.title, true, resolve, reject);
3753
+ oChipInstance.setTitle(oBookmarkConfig.title, true, resolve, (sErrorMessage) => {
3754
+ reject(new Error(sErrorMessage));
3755
+ });
3694
3756
  } else {
3695
3757
  resolve();
3696
3758
  }
@@ -3722,7 +3784,7 @@ sap.ui.define([
3722
3784
  this.isCustomTile = function (tile) {
3723
3785
  return !isAppLauncher(tile);
3724
3786
  };
3725
- };
3787
+ }
3726
3788
 
3727
3789
  /**
3728
3790
  * Returns raw catalog tile data that can be used to instantiate the tile
@@ -3739,8 +3801,9 @@ sap.ui.define([
3739
3801
  return new Promise((resolve, reject) => {
3740
3802
  // There is no good way to access the raw data as it is normalized and well hidden in closures in sap.ushell_abap.pbServices.ui2
3741
3803
  // Therefore we trigger the allCatalogs request again which reads from the cache of the OData wrapper
3742
- oUI2PageBuildingService.readAllCatalogs(PAGE_ID_WITHOUT_TM, resolve, reject,
3743
- "type eq 'CATALOG_PAGE' or type eq 'H' or type eq 'SM_CATALOG' or type eq 'REMOTE'", "title", true);
3804
+ oUI2PageBuildingService.readAllCatalogs(PAGE_ID_WITHOUT_TM, resolve, (sErrorMessage) => {
3805
+ reject(new Error(sErrorMessage));
3806
+ }, "type eq 'CATALOG_PAGE' or type eq 'H' or type eq 'SM_CATALOG' or type eq 'REMOTE'", "title", true);
3744
3807
  });
3745
3808
  })
3746
3809
  .then((oResponse) => {