renamed block scope

This commit is contained in:
array-in-a-matrix 2024-08-07 11:16:37 -04:00
parent fb74d955ac
commit e8466d08a2

View file

@ -36,11 +36,11 @@ proc createUpdateRoutes*() =
except NotFoundError: except NotFoundError:
resp Http404, "File does not exist.\n" resp Http404, "File does not exist.\n"
block FileDoesNotExist: block FileDoesNotExistCheck:
try: try:
db.select(file, """"File".name = $1""", newName) db.select(file, """"File".name = $1""", newName)
except NotFoundError: except NotFoundError:
break FileDoesNotExist break FileDoesNotExistCheck
resp Http403, "File with that name already exists.\n" resp Http403, "File with that name already exists.\n"
let newPath = file.path[0..^file.name.len+1] & newName let newPath = file.path[0..^file.name.len+1] & newName