Skip to content

Commit 6c4cdeb

Browse files
committed
Handle container connection conflicts in backup strategy
- Catch ConflictException when connecting to Docker container - Wrap exception in BackupException with detailed message
1 parent 2e13f69 commit 6c4cdeb

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/main/java/tech/nomad4/backupmanager/isolate/backup/strategy/PostgresBackupStrategy.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ public void onNext(Frame frame) {
105105

106106
} catch (BackupException e) {
107107
throw e;
108+
} catch (com.github.dockerjava.api.exception.ConflictException e) {
109+
throw new BackupException(
110+
"Failed to connect container: " + command.getContainerId(), e);
108111
} catch (IOException e) {
109112
throw new BackupException("Failed to open output file: " + outputPath, e);
110113
} catch (InterruptedException e) {

0 commit comments

Comments
 (0)