Skip to content

Commit

Permalink
Errors: Include path in discovery error message #6826
Browse files Browse the repository at this point in the history
  • Loading branch information
ckamm committed Oct 29, 2018
1 parent 67d0c20 commit 796dccf
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/libsync/discoveryphase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -664,8 +664,17 @@ csync_vio_handle_t *DiscoveryJob::remote_vio_opendir_hook(const char *url,
if (directoryResult->code != 0) {
qCDebug(lcDiscovery) << directoryResult->code << "when opening" << url << "msg=" << directoryResult->msg;
errno = directoryResult->code;

// save the error string to the context
discoveryJob->_csync_ctx->error_string = directoryResult->msg;
QString errorString = directoryResult->path;
if (errorString.startsWith("/"))
errorString = errorString.mid(1);
if (!directoryResult->msg.isEmpty()) {
errorString.append(": ");
errorString.append(directoryResult->msg);
}
discoveryJob->_csync_ctx->error_string = errorString;

return NULL;
}

Expand Down

0 comments on commit 796dccf

Please sign in to comment.