Skip to content

Commit

Permalink
fix web worker error handling (#6126)
Browse files Browse the repository at this point in the history
  • Loading branch information
mollymerp committed Feb 9, 2018
1 parent e395884 commit b60a83c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/util/actor.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class Actor {
sourceMapId: this.mapId,
type: '<response>',
id: String(id),
error: err ? String(err) : null,
error: err ? serialize(err) : null,
data: serialize(data, buffers)
}, buffers);
};
Expand All @@ -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));
}
Expand Down
1 change: 1 addition & 0 deletions src/util/web_worker_transfer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']});
Expand Down

0 comments on commit b60a83c

Please sign in to comment.