Browse Source

Throw error when url not found - #960

pull/1014/merge
Masayuki Tanaka 10 years ago
parent
commit
1b4dd57190
  1. 3
      c3.js
  2. 2
      c3.min.js
  3. 3
      src/data.convert.js

3
c3.js

@ -1915,6 +1915,9 @@
var $$ = this, type = mimeType ? mimeType : 'csv';
$$.d3.xhr(url, function (error, data) {
var d;
if (!data) {
throw new Error(error.responseURL + ' ' + error.status + ' (' + error.statusText + ')');
}
if (type === 'json') {
d = $$.convertJsonToData(JSON.parse(data.response), keys);
} else if (type === 'tsv') {

2
c3.min.js vendored

File diff suppressed because one or more lines are too long

3
src/data.convert.js

@ -2,6 +2,9 @@ c3_chart_internal_fn.convertUrlToData = function (url, mimeType, keys, done) {
var $$ = this, type = mimeType ? mimeType : 'csv';
$$.d3.xhr(url, function (error, data) {
var d;
if (!data) {
throw new Error(error.responseURL + ' ' + error.status + ' (' + error.statusText + ')');
}
if (type === 'json') {
d = $$.convertJsonToData(JSON.parse(data.response), keys);
} else if (type === 'tsv') {

Loading…
Cancel
Save