comparison MoinMoin/action/SyncPages.py @ 3414:898a544b8f74

make syncpages not crash on remote errors
author Johannes Berg <johannes AT sipsolutions DOT net>
date Sat, 22 Mar 2008 16:49:43 +0100
parents a1322262398a
children 60e0a3979520
comparison
equal deleted inserted replaced
3413:fc0f007111e9 3414:898a544b8f74
187 187
188 local = MoinLocalWiki(self.request, params["localPrefix"], params["pageList"]) 188 local = MoinLocalWiki(self.request, params["localPrefix"], params["pageList"])
189 try: 189 try:
190 remote = MoinRemoteWiki(self.request, params["remoteWiki"], params["remotePrefix"], params["pageList"], params["user"], params["password"], verbose=debug) 190 remote = MoinRemoteWiki(self.request, params["remoteWiki"], params["remotePrefix"], params["pageList"], params["user"], params["password"], verbose=debug)
191 except (UnsupportedWikiException, NotAllowedException), (msg, ): 191 except (UnsupportedWikiException, NotAllowedException), (msg, ):
192 raise ActionStatus(msg) 192 raise ActionStatus(msg, "error")
193 193
194 if not remote.valid: 194 if not remote.valid:
195 raise ActionStatus(_("The ''remoteWiki'' is unknown.", wiki=True), "error") 195 raise ActionStatus(_("The ''remoteWiki'' is unknown.", wiki=True), "error")
196 # if only the username is supplied, we ask for the password 196 # if only the username is supplied, we ask for the password
197 if params["user"] and not params["password"]: 197 if params["user"] and not params["password"]:
198 return self.show_password_form() 198 return self.show_password_form()
199 except ActionStatus, e: 199 except ActionStatus, e:
200 self.request.theme.add_msg(u'<p class="error">%s</p>\n' % (e.args[0], ), e.args[1]) 200 self.request.theme.add_msg(*e.args)
201 else: 201 else:
202 try: 202 try:
203 try: 203 try:
204 self.sync(params, local, remote) 204 self.sync(params, local, remote)
205 except Exception, e: 205 except Exception, e: