Skip to content
Snippets Groups Projects
Commit 8d82882e authored by inso's avatar inso
Browse files

Merge pull request #409 from vtexier/dev

fix some crashes
parents 26173b11 c6ddd5f0
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -246,7 +246,7 @@ class Identity(QObject): ...@@ -246,7 +246,7 @@ class Identity(QObject):
if person_uid == self.uid: if person_uid == self.uid:
return True return True
except errors.UcoinError as e: except errors.UcoinError as e:
if e.ucode in (errors.NO_MATCHING_IDENTITY): if e.ucode in (errors.NO_MATCHING_IDENTITY, errors.NO_MEMBER_MATCHING_PUB_OR_UID):
logging.debug("Lookup error : {0}".format(str(e))) logging.debug("Lookup error : {0}".format(str(e)))
except NoPeerAvailable as e: except NoPeerAvailable as e:
logging.debug(str(e)) logging.debug(str(e))
......
...@@ -6,6 +6,7 @@ Created on 8 mars 2014 ...@@ -6,6 +6,7 @@ Created on 8 mars 2014
import logging import logging
import asyncio import asyncio
import aiohttp import aiohttp
from ucoinpy.api import errors from ucoinpy.api import errors
...@@ -65,6 +66,7 @@ class StepPageInit(Step): ...@@ -65,6 +66,7 @@ class StepPageInit(Step):
server = self.config_dialog.lineedit_server.text() server = self.config_dialog.lineedit_server.text()
port = self.config_dialog.spinbox_port.value() port = self.config_dialog.spinbox_port.value()
logging.debug("Is valid ? ") logging.debug("Is valid ? ")
self.config_dialog.label_error.setText(self.tr("connecting..."))
try: try:
self.node = await Node.from_address(None, server, port, session=aiohttp.ClientSession()) self.node = await Node.from_address(None, server, port, session=aiohttp.ClientSession())
community = Community.create(self.node) community = Community.create(self.node)
...@@ -78,12 +80,15 @@ class StepPageInit(Step): ...@@ -78,12 +80,15 @@ class StepPageInit(Step):
self.config_dialog.label_error.setText(str(e)) self.config_dialog.label_error.setText(str(e))
#except (MalformedDocumentError, ValueError) as e: #except (MalformedDocumentError, ValueError) as e:
# self.config_dialog.label_error.setText(str(e)) # self.config_dialog.label_error.setText(str(e))
except aiohttp.errors.TimeoutError:
self.config_dialog.label_error.setText(self.tr("Could not connect. Check hostname, ip address or port"))
@asyncify @asyncify
async def check_connect(self, checked=False): async def check_connect(self, checked=False):
server = self.config_dialog.lineedit_server.text() server = self.config_dialog.lineedit_server.text()
port = self.config_dialog.spinbox_port.value() port = self.config_dialog.spinbox_port.value()
logging.debug("Is valid ? ") logging.debug("Is valid ? ")
self.config_dialog.label_error.setText(self.tr("connecting..."))
try: try:
self.node = await Node.from_address(None, server, port, session=aiohttp.ClientSession()) self.node = await Node.from_address(None, server, port, session=aiohttp.ClientSession())
community = Community.create(self.node) community = Community.create(self.node)
...@@ -108,12 +113,15 @@ Yours : {0}, the network : {1}""".format(registered[1], registered[2]))) ...@@ -108,12 +113,15 @@ Yours : {0}, the network : {1}""".format(registered[1], registered[2])))
self.config_dialog.label_error.setText(str(e)) self.config_dialog.label_error.setText(str(e))
except NoPeerAvailable: except NoPeerAvailable:
self.config_dialog.label_error.setText(self.tr("Could not connect. Check node peering entry")) self.config_dialog.label_error.setText(self.tr("Could not connect. Check node peering entry"))
except aiohttp.errors.TimeoutError:
self.config_dialog.label_error.setText(self.tr("Could not connect. Check hostname, ip address or port"))
@asyncify @asyncify
async def check_register(self, checked=False): async def check_register(self, checked=False):
server = self.config_dialog.lineedit_server.text() server = self.config_dialog.lineedit_server.text()
port = self.config_dialog.spinbox_port.value() port = self.config_dialog.spinbox_port.value()
logging.debug("Is valid ? ") logging.debug("Is valid ? ")
self.config_dialog.label_error.setText(self.tr("connecting..."))
try: try:
session = aiohttp.ClientSession() session = aiohttp.ClientSession()
self.node = await Node.from_address(None, server, port, session=session) self.node = await Node.from_address(None, server, port, session=session)
...@@ -152,6 +160,8 @@ Yours : {0}, the network : {1}""".format(registered[1], registered[2]))) ...@@ -152,6 +160,8 @@ Yours : {0}, the network : {1}""".format(registered[1], registered[2])))
self.config_dialog.label_error.setText(str(e)) self.config_dialog.label_error.setText(str(e))
except NoPeerAvailable: except NoPeerAvailable:
self.config_dialog.label_error.setText(self.tr("Could not connect. Check node peering entry")) self.config_dialog.label_error.setText(self.tr("Could not connect. Check node peering entry"))
except aiohttp.errors.TimeoutError:
self.config_dialog.label_error.setText(self.tr("Could not connect. Check hostname, ip address or port"))
def is_valid(self): def is_valid(self):
return self.node is not None return self.node is not None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment