Catch error when something that is not the GNS3 server answer to virtualbox requests

Fix #1155
This commit is contained in:
Julien Duponchelle 2017-08-03 16:31:28 +02:00
parent 3bb8cdafb2
commit 211f48d981
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8

View File

@ -15,7 +15,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import json.decoder
import aiohttp
import logging
import asyncio
@ -232,10 +231,11 @@ class VirtualBoxGNS3VM(BaseGNS3VM):
pass
if resp:
try:
json_data = yield from resp.json()
except ValueError:
pass
if resp.status < 300:
try:
json_data = yield from resp.json()
except ValueError:
pass
resp.close()
session.close()