|
5 | 5 | * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause |
6 | 6 | */ |
7 | 7 |
|
8 | | -import { DuplicateKeyError, KeyNotFoundInStorageError, TargetPropertyNotFoundError } from '../../error/errorInterfaces'; |
| 8 | +import { |
| 9 | + DuplicateKeyError, |
| 10 | + KeyNotFoundInStorageError, |
| 11 | + ProcessingError, |
| 12 | + TargetPropertyNotFoundError, |
| 13 | +} from '../../error/errorInterfaces'; |
9 | 14 | import { |
10 | 15 | Flexipage, |
11 | 16 | FlexiComponentInstanceProperty, |
@@ -177,6 +182,10 @@ function createNewPropsForOmniScript( |
177 | 182 | throw new KeyNotFoundInStorageError(nameKey, 'Omniscript'); |
178 | 183 | } |
179 | 184 |
|
| 185 | + if (!migratedScriptName.migrationSuccess) { |
| 186 | + throw new ProcessingError(nameKey, 'Omniscript'); |
| 187 | + } |
| 188 | + |
180 | 189 | if (migratedScriptName.isDuplicate) { |
181 | 190 | throw new DuplicateKeyError(nameKey, 'Omniscript'); |
182 | 191 | } |
@@ -215,6 +224,10 @@ function createNewPropsForFlexCard( |
215 | 224 | throw new KeyNotFoundInStorageError(nameKey, 'Flexcard'); |
216 | 225 | } |
217 | 226 |
|
| 227 | + if (!migratedCardName.migrationSuccess) { |
| 228 | + throw new ProcessingError(nameKey, 'Flexcard'); |
| 229 | + } |
| 230 | + |
218 | 231 | if (migratedCardName.isDuplicate) { |
219 | 232 | throw new DuplicateKeyError(nameKey, 'Flexcard'); |
220 | 233 | } |
@@ -253,8 +266,14 @@ function createNewPropsForStandardOmniScript( |
253 | 266 | // Look up in osStandardStorage using the object key |
254 | 267 | const targetDataFromStorage: OmniScriptStorage | undefined = StorageUtil.getStandardOmniScript(storage, lookupKey); |
255 | 268 |
|
| 269 | + const nameKey = `${currentType}_${currentSubType}_${currentLanguage}`; |
| 270 | + |
256 | 271 | if (!targetDataFromStorage) { |
257 | | - throw new KeyNotFoundInStorageError(`${currentType}_${currentSubType}_${currentLanguage}`, 'Omniscript'); |
| 272 | + throw new KeyNotFoundInStorageError(nameKey, 'Omniscript'); |
| 273 | + } |
| 274 | + |
| 275 | + if (!targetDataFromStorage.migrationSuccess) { |
| 276 | + throw new ProcessingError(nameKey, 'Omniscript'); |
258 | 277 | } |
259 | 278 |
|
260 | 279 | // Return the new properties |
@@ -287,6 +306,10 @@ function createNewPropsForStandardFlexCard( |
287 | 306 | throw new DuplicateKeyError(currentFlexCardName, 'Flexcard'); |
288 | 307 | } |
289 | 308 |
|
| 309 | + if (!targetDataFromStorage.migrationSuccess) { |
| 310 | + throw new ProcessingError(currentFlexCardName, 'Flexcard'); |
| 311 | + } |
| 312 | + |
290 | 313 | if (targetDataFromStorage.error) { |
291 | 314 | throw new Error(targetDataFromStorage.error.join('\n\n')); |
292 | 315 | } |
|
0 commit comments