Improve error message.
This commit is contained in:
parent
34935ca4b6
commit
c92948e8b9
@ -72,6 +72,18 @@ StringBuilder &operator<<(StringBuilder &string_builder, FileLocationSource sour
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StringBuilder &operator<<(StringBuilder &string_builder, const NewRemoteFileLocation &location) {
|
||||||
|
if (location.is_full_alive) {
|
||||||
|
string_builder << "alive ";
|
||||||
|
}
|
||||||
|
if (location.full) {
|
||||||
|
string_builder << location.full.value();
|
||||||
|
} else {
|
||||||
|
string_builder << "[no location]";
|
||||||
|
}
|
||||||
|
return string_builder << " from " << location.full_source;
|
||||||
|
}
|
||||||
|
|
||||||
StringBuilder &operator<<(StringBuilder &string_builder, FileManager::Query::Type type) {
|
StringBuilder &operator<<(StringBuilder &string_builder, FileManager::Query::Type type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case FileManager::Query::Type::UploadByHash:
|
case FileManager::Query::Type::UploadByHash:
|
||||||
@ -1692,8 +1704,9 @@ Status FileManager::merge(FileId x_file_id, FileId y_file_id, bool no_sync) {
|
|||||||
if (size_i == -1) {
|
if (size_i == -1) {
|
||||||
try_flush_node_info(x_node, "merge 2");
|
try_flush_node_info(x_node, "merge 2");
|
||||||
try_flush_node_info(y_node, "merge 3");
|
try_flush_node_info(y_node, "merge 3");
|
||||||
return Status::Error(
|
return Status::Error(400, PSLICE() << "Can't merge files " << x_node->local_ << '/' << x_node->remote_ << " and "
|
||||||
400, PSLICE() << "Can't merge files. Different size: " << x_node->size_ << " and " << y_node->size_);
|
<< y_node->local_ << '/' << y_node->remote_
|
||||||
|
<< ". Different size: " << x_node->size_ << " and " << y_node->size_);
|
||||||
}
|
}
|
||||||
if (encryption_key_i == -1) {
|
if (encryption_key_i == -1) {
|
||||||
if (nodes[remote_i]->remote_.full && nodes[local_i]->local_.type() != LocalFileLocation::Type::Partial) {
|
if (nodes[remote_i]->remote_.full && nodes[local_i]->local_.type() != LocalFileLocation::Type::Partial) {
|
||||||
|
@ -66,6 +66,8 @@ struct NewRemoteFileLocation {
|
|||||||
int64 ready_size = 0;
|
int64 ready_size = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
StringBuilder &operator<<(StringBuilder &string_builder, const NewRemoteFileLocation &location);
|
||||||
|
|
||||||
class FileNode {
|
class FileNode {
|
||||||
public:
|
public:
|
||||||
FileNode(LocalFileLocation local, NewRemoteFileLocation remote, unique_ptr<FullGenerateFileLocation> generate,
|
FileNode(LocalFileLocation local, NewRemoteFileLocation remote, unique_ptr<FullGenerateFileLocation> generate,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user