diff --git a/src/util/actor.js b/src/util/actor.js index b5fcdd868d3..e4cd66a2a96 100644 --- a/src/util/actor.js +++ b/src/util/actor.js @@ -69,7 +69,7 @@ class Actor { sourceMapId: this.mapId, type: '', id: String(id), - error: err ? String(err) : null, + error: err ? serialize(err) : null, data: serialize(data, buffers) }, buffers); }; @@ -78,7 +78,7 @@ class Actor { callback = this.callbacks[data.id]; delete this.callbacks[data.id]; if (callback && data.error) { - callback(new Error(data.error)); + callback(deserialize(data.error)); } else if (callback) { callback(null, deserialize(data.data)); } diff --git a/src/util/web_worker_transfer.js b/src/util/web_worker_transfer.js index d510691d4b8..9357c0f2fc5 100644 --- a/src/util/web_worker_transfer.js +++ b/src/util/web_worker_transfer.js @@ -87,6 +87,7 @@ Grid.deserialize = function deserializeGrid(serialized: ArrayBuffer): Grid { register('Grid', Grid); register('Color', Color); +register('Error', Error); register('StylePropertyFunction', StylePropertyFunction); register('StyleExpression', StyleExpression, {omit: ['_evaluator']});