diff --git a/src/common/requests/errors.cr b/src/common/requests/errors.cr index a4e349e..f95e3ab 100644 --- a/src/common/requests/errors.cr +++ b/src/common/requests/errors.cr @@ -42,10 +42,10 @@ class FileStorage::Errors JSONIPC.request FileExists, 204 do property mid : String property reason = "file already present" - property filedigest : String + property path : String property next_chunk : Int32 - def initialize(@mid, @filedigest, @next_chunk) + def initialize(@mid, @path, @next_chunk) end end FileStorage.errors << FileExists diff --git a/src/server/storage.cr b/src/server/storage.cr index 5305400..261b910 100644 --- a/src/server/storage.cr +++ b/src/server/storage.cr @@ -112,6 +112,9 @@ class FileStorage::Storage rescue e : IndexError # In case the file was completely uploaded already. return FileStorage::Errors::FileFullyUploaded.new mid, file_digest + rescue e + puts "error during transfer_info.chunks.sort.first" + raise e end end @@ -192,7 +195,7 @@ class FileStorage::Storage # in this case: ignore the upload request. begin next_chunk = transfer_info.chunks.sort.first - return FileStorage::Errors::FileExists.new mid, file_digest, next_chunk + return FileStorage::Errors::FileExists.new mid, path, next_chunk rescue e : IndexError # In case the file was completely uploaded already. return FileStorage::Errors::FileFullyUploaded.new mid, file_digest