Vega-lite: Consistently use `vega-util` error instead of `throw new Error(...)`

Created on 22 Feb 2018  路  5Comments  路  Source: vega/vega-lite

All 5 comments

I would like to work on this issue.

@ydlamba Excellent. You can ask @kanitw specific questions if you have any.

When I try to throw the error using error function from vega-util, the tsc is giving the error (error TS7030: Not all code paths return a value.) which is possibly due to the fact that no return value is explicitly specified when throwing the error by calling a function.

I see. Then I guess we can stick with standard throw then. (return error() could work too, but it's not really short anymore.)

Instead, we should consistently remove error and use throw new Error() then.

At few places error() is used. Changing them to throw new Error().

Was this page helpful?
0 / 5 - 0 ratings