Exemple #1
0
def error(ctx, cmd, returnCode):
	"""handle library errors"""
	errNum = csynclib.csync_get_error(ctx)
	errMsg = csynclib.csync_get_error_string(ctx)
	if not errMsg:
		if errNum == 20 and cmd == 'csync_update':
			errMsg = 'This is an authentication problem with the server, check user/pass.'
		if errNum == 26 and cmd == 'csync_update':
			errMsg = 'This is a remote folder destination issue, check that the remote folder exists on ownCloud.'
	print 'ERROR: %s exited %s, error %s: %s' % (
		cmd,
		returnCode,
		errNum,
		errMsg,
		)
	sys.exit(1)
Exemple #2
0
	def error(self, cmd, returnCode):
		"""handle library errors"""
		errNum = csynclib.csync_get_error(self.ctx)
		errMsg = csynclib.csync_get_error_string(self.ctx)
		if not errMsg:
			if errNum == csynclib.CSYNC_ERR_AUTH_SERVER and cmd == 'csync_update':
				errMsg = 'The user could not be authenticated with the server, check username/password combination.'
			if errNum == csynclib.CSYNC_ERR_NOT_FOUND and cmd == 'csync_update':
				errMsg = 'The remote folder "' + self.cfg['dst'] + '" could not be found, check that the remote folder exists on ownCloud.'
		self.logger.error('%s exited with %s, csync(%s) error %s: %s',
			cmd,
			returnCode,
			self.libVersion,
			errNum,
			errMsg,
			)
		sys.exit(1)
Exemple #3
0
def error(ctx, cmd, returnCode):
	"""handle library errors"""
	libVersion = csynclib.csync_version(0,40,1)
	errNum = csynclib.csync_get_error(ctx)
	errMsg = csynclib.csync_get_error_string(ctx)
	if not errMsg:
		if errNum == csynclib.CSYNC_ERR_AUTH_SERVER and cmd == 'csync_update':
			errMsg = 'This is an authentication problem with the server, check user/pass.'
		if errNum == csynclib.CSYNC_ERR_NOT_FOUND and cmd == 'csync_update':
			errMsg = 'This is a remote folder destination issue, check that the remote folder exists on ownCloud.'
	print 'ERROR: %s exited with %s, csync(%s) error %s: %s' % (
		cmd,
		returnCode,
		libVersion,
		errNum,
		errMsg,
		)
	sys.exit(1)
Exemple #4
0
def error(ctx, cmd, returnCode):
    """handle library errors"""
    libVersion = csynclib.csync_version(0, 40, 1)
    errNum = csynclib.csync_get_error(ctx)
    errMsg = csynclib.csync_get_error_string(ctx)
    if not errMsg:
        if errNum == csynclib.CSYNC_ERR_AUTH_SERVER and cmd == 'csync_update':
            errMsg = 'This is an authentication problem with the server, check user/pass.'
        if errNum == csynclib.CSYNC_ERR_NOT_FOUND and cmd == 'csync_update':
            errMsg = 'This is a remote folder destination issue, check that the remote folder exists on ownCloud.'
    print 'ERROR: %s exited with %s, csync(%s) error %s: %s' % (
        cmd,
        returnCode,
        libVersion,
        errNum,
        errMsg,
    )
    sys.exit(1)