Commit 2284466
authored
feat: add NO_NAS_IN_ACCOUNT failure reason and refactor Synology extension exception handling (#1480)
Changes:
Core SPI Updates
* New Failure Reason: Added NO_NAS_IN_ACCOUNT to FailureReasons enum.
* New Exception: Created NoNasInAccountException in the SPI to handle
cases where the destination account lacks a
NAS setup.
Synology Extension Refactoring
* Exception Standardization: Removed custom Synology exception classes
(e.g., SynologyException,
SynologyImportException, SynologyErrorCode) and replaced them with
standard SPI exceptions:
* SynologyImportException -> UploadErrorException for general errors
* Enhanced Error Handling:
* HTTP 413: Now throws DestinationMemoryFullException.
* HTTP 422: Checks specific Synology error codes (2000, 2001) and throws
NoNasInAccountException.
* Code Cleanup: Updated SynologyMediaImporter, SynologyPhotosImporter,
and SynologyVideosImporter to directly re-throw exceptions for the
framework to handle, rather than catching them and returning failure
results.
* Avoid using lambda function for checked exception
* Replace `forEach()` by for-loop
* Replace atomic `readyAlbumMap.compute()` by synchronized lock
protected map operations
Testing
* Updated all Synology unit tests to assert against the new SPI
exceptions.
* Added specific test cases to verify handling of HTTP 413 and 422
response codes.1 parent 2890c47 commit 2284466
File tree
20 files changed
+413
-493
lines changed- extensions/data-transfer/portability-data-transfer-synology/src
- main/java/org/datatransferproject/datatransfer/synology
- constant
- exceptions
- media
- photos
- service
- uploader
- utils
- videos
- test/java/org/datatransferproject/datatransfer/synology
- service
- uploader
- utils
- portability-spi-transfer/src/main/java/org/datatransferproject/spi/transfer/types
20 files changed
+413
-493
lines changedLines changed: 0 additions & 45 deletions
This file was deleted.
Lines changed: 0 additions & 54 deletions
This file was deleted.
Lines changed: 0 additions & 51 deletions
This file was deleted.
Lines changed: 0 additions & 31 deletions
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
0 commit comments