Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include source name in invalid GeoJSON error #8113

Merged
merged 1 commit into from
Apr 3, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/source/geojson_worker_source.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class GeoJSONWorkerSource extends VectorTileWorkerSource {
if (err || !data) {
return callback(err);
} else if (typeof data !== 'object') {
return callback(new Error("Input data is not a valid GeoJSON object."));
return callback(new Error(`Input data given to '${params.source}' is not a valid GeoJSON object.`));
} else {
rewind(data, true);

Expand Down Expand Up @@ -267,10 +267,10 @@ class GeoJSONWorkerSource extends VectorTileWorkerSource {
try {
return callback(null, JSON.parse(params.data));
} catch (e) {
return callback(new Error("Input data is not a valid GeoJSON object."));
return callback(new Error(`Input data given to '${params.source}' is not a valid GeoJSON object.`));
}
} else {
return callback(new Error("Input data is not a valid GeoJSON object."));
return callback(new Error(`Input data given to '${params.source}' is not a valid GeoJSON object.`));
}
}

Expand Down