Skip to content

Commit dca46c6

Browse files
author
ac2pic
committedOct 29, 2023
Bug fixes
1 parent a9f8792 commit dca46c6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
 

‎src/commands.nim

+9
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@ proc dumpSave(cmd: ClientRequest, client: AsyncSocket, mountId: string) {.async.
160160
let sourceFile = joinPath(mntFolder, relativePath)
161161
try:
162162
copyFile(sourceFile, targetFile)
163+
except IOError:
164+
respondWithError(client, "E:COPY_FAILED")
165+
failed = true
166+
break
163167
except OSError:
164168
respondWithError(client, "E:COPY_FAILED")
165169
failed = true
@@ -208,10 +212,15 @@ proc updateSave(cmd: ClientRequest, client: AsyncSocket, mountId: string) {.asyn
208212
let sourcePath = joinPath(cmd.sourceFolder, relativePath)
209213
try:
210214
copyFile(sourcePath, targetPath)
215+
except IOError:
216+
respondWithError(client, "E:COPY_FAILED")
217+
failed = true
218+
break
211219
except OSError:
212220
respondWithError(client, "E:COPY_FAILED")
213221
failed = true
214222
break
223+
215224
discard setuid(0)
216225
discard umountSave(mntFolder, handle, false)
217226
discard rmdir(mntFolder.cstring)

0 commit comments

Comments
 (0)
Please sign in to comment.