@salesforce/lds-worker-api 1.266.0-dev2 → 1.266.0-dev21

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.
@@ -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.266.0-dev2-7c2f3615f
1051
+ // version: 1.266.0-dev21-b2a247476