@salesforce/lds-worker-api 1.278.0 → 1.280.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.
@@ -4,7 +4,7 @@
4
4
  * For full license text, see the LICENSE.txt file
5
5
  */
6
6
 
7
- /* *******************************************************************************************
7
+ /*
8
8
  * ATTENTION!
9
9
  * THIS IS A GENERATED FILE FROM https://github.com/salesforce-experience-platform-emu/lds-lightning-platform
10
10
  * If you would like to contribute to LDS, please follow the steps outlined in the git repo.
@@ -379,8 +379,22 @@ function invokeAdapterWithDraftToReplace(adapterId, config, draftIdToReplace, on
379
379
  draftIds !== undefined &&
380
380
  draftIds.length > 0) {
381
381
  const draftId = draftIds[draftIds.length - 1];
382
- draftManager.replaceAction(draftIdToReplace, draftId).then(() => {
382
+ draftManager
383
+ .replaceAction(draftIdToReplace, draftId)
384
+ .then(() => {
383
385
  onResponse(responseValue);
386
+ })
387
+ .catch((error) => {
388
+ let message = 'Unknown error replacing draft';
389
+ if (error instanceof Error) {
390
+ message = error.message;
391
+ }
392
+ else if (typeof error === 'string') {
393
+ message = error;
394
+ }
395
+ onResponse({
396
+ error: createNativeFetchErrorResponse(message),
397
+ });
384
398
  });
385
399
  }
386
400
  else {
@@ -1034,4 +1048,4 @@ if (process.env.NODE_ENV !== 'production') {
1034
1048
  }
1035
1049
 
1036
1050
  export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
1037
- // version: 1.278.0-f0e8ebcd6
1051
+ // version: 1.280.0-92c104b03