void CSyncThread::handleSyncError(CSYNC *ctx, const char *state) { CSYNC_STATUS err = csync_get_status( ctx ); const char *errMsg = csync_get_status_string( ctx ); QString errStr = csyncErrorToString(err); if( errMsg ) { if( !errStr.endsWith(" ")) { errStr.append(" "); } errStr += QString::fromUtf8(errMsg); } // if there is csyncs url modifier in the error message, replace it. if( errStr.contains("ownclouds://") ) errStr.replace("ownclouds://", "https://"); if( errStr.contains("owncloud://") ) errStr.replace("owncloud://", "http://"); qDebug() << " #### ERROR during "<< state << ": " << errStr; if( CSYNC_STATUS_IS_EQUAL( err, CSYNC_STATUS_ABORTED) ) { qDebug() << "Update phase was aborted by user!"; } else if( CSYNC_STATUS_IS_EQUAL( err, CSYNC_STATUS_SERVICE_UNAVAILABLE ) || CSYNC_STATUS_IS_EQUAL( err, CSYNC_STATUS_CONNECT_ERROR )) { emit csyncUnavailable(); } else { emit csyncError(errStr); } csync_commit(_csync_ctx); emit finished(); _syncMutex.unlock(); _thread.quit(); }
void SyncEngine::handleSyncError(CSYNC *ctx, const char *state) { CSYNC_STATUS err = csync_get_status( ctx ); const char *errMsg = csync_get_status_string( ctx ); QString errStr = csyncErrorToString(err); if( errMsg ) { if( !errStr.endsWith(" ")) { errStr.append(" "); } errStr += QString::fromUtf8(errMsg); } // Special handling CSYNC_STATUS_INVALID_CHARACTERS if (err == CSYNC_STATUS_INVALID_CHARACTERS) { errStr = tr("Invalid characters, please rename \"%1\"").arg(errMsg); } // if there is csyncs url modifier in the error message, replace it. if( errStr.contains("ownclouds://") ) errStr.replace("ownclouds://", "https://"); if( errStr.contains("owncloud://") ) errStr.replace("owncloud://", "http://"); qDebug() << " #### ERROR during "<< state << ": " << errStr; if( CSYNC_STATUS_IS_EQUAL( err, CSYNC_STATUS_ABORTED) ) { qDebug() << "Update phase was aborted by user!"; } else if( CSYNC_STATUS_IS_EQUAL( err, CSYNC_STATUS_SERVICE_UNAVAILABLE ) || CSYNC_STATUS_IS_EQUAL( err, CSYNC_STATUS_CONNECT_ERROR )) { emit csyncUnavailable(); } else { emit csyncError(errStr); } finalize(false); }
void CSyncThread::handleSyncError(CSYNC *ctx, const char *state) { CSYNC_ERROR_CODE err = csync_get_error( ctx ); const char *errMsg = csync_get_error_string( ctx ); QString errStr = csyncErrorToString(err, errMsg); qDebug() << " #### ERROR during "<< state << ": " << errStr; switch (err) { case CSYNC_ERR_SERVICE_UNAVAILABLE: case CSYNC_ERR_CONNECT: emit csyncUnavailable(); break; default: emit csyncError(errStr); } }
void CSyncThread::handleSyncError(CSYNC *ctx, const char *state) { CSYNC_STATUS err = CSYNC_STATUS(csync_get_status( ctx )); const char *errMsg = csync_get_status_string( ctx ); QString errStr = csyncErrorToString(err); if( errMsg ) { errStr += QString::fromUtf8(errMsg); } qDebug() << " #### ERROR during "<< state << ": " << errStr; if( CSYNC_STATUS_IS_EQUAL( err, CSYNC_STATUS_SERVICE_UNAVAILABLE ) || CSYNC_STATUS_IS_EQUAL( err, CSYNC_STATUS_CONNECT_ERROR )) { emit csyncUnavailable(); } else { emit csyncError(errStr); } csync_commit(_csync_ctx); emit finished(); _syncMutex.unlock(); thread()->quit(); }