Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f099117

Browse files
committed
add error message when topojson file isn't found
1 parent cf95a06 commit f099117

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/plots/geo/geo.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,17 @@ proto.plot = function(geoData, fullLayout, promises) {
102102

103103
promises.push(new Promise(function(resolve) {
104104
d3.json(topojsonPath, function(error, topojson) {
105+
if(error) {
106+
if(error.status === 404) {
107+
console.error([
108+
'plotly.js could not find topojson file at',
109+
topojsonPath, '.',
110+
'Make sure the *topojsonURL* plot config option',
111+
'is set properly.'
112+
].join(' '));
113+
}
114+
return;
115+
}
105116

106117
_this.topojson = topojson;
107118
PlotlyGeoAssets.topojson[_this.topojsonName] = topojson;

0 commit comments

Comments
 (0)