From c784fa42e99e6b2862ddf73f80a7ae9a040dc9c6 Mon Sep 17 00:00:00 2001 From: Zach Pomerantz Date: Tue, 21 Jun 2016 11:34:23 -0700 Subject: [PATCH] log failure to fetch metadata --- scripts/tutorials/getDomainMetadata.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/tutorials/getDomainMetadata.js b/scripts/tutorials/getDomainMetadata.js index 0a6f742823..8c347a09ae 100644 --- a/scripts/tutorials/getDomainMetadata.js +++ b/scripts/tutorials/getDomainMetadata.js @@ -16,14 +16,21 @@ location.hostChanged.connect(function(host) { // Fetch the domain ID from the metaverse var placeData = request(SERVER + '/places/' + host); - if (!placeData) { return; } + if (!placeData) { + print('Cannot find place name - abandoning metadata request for', host); + return; + + } var domainID = placeData.data.place.domain.id; print('Domain ID:', domainID); // Fetch the domain metadata from the metaverse var domainData = request(SERVER + '/domains/' + domainID); print(SERVER + '/domains/' + domainID); - if (!domainData) { return; } + if (!domainData) { + print('Cannot find domain data - abandoning metadata request for', domainID); + return; + } var metadata = domainData.domain; print('Domain metadata:', JSON.stringify(metadata));