message: Catch any error in embed and reject promise.
diff: @@ -30,6 +30,7 @@ const PREPROCESSOR = {
  * @param opt A JavaScript object containing options for embedding.
  */
  const embed: Export = (el: Element, spec: any, opt: Options) => {
  + try {
  opt = opt || {};
  const actions = opt.actions !== undefined ? opt.actions : true;
  @@ -93,12 +94,7 @@ const embed: Export = (el: Element, spec: any, opt: Options) => {
  vgSpec = opt.onBeforeParse(vgSpec);
  }
  - let runtime;
  - try {
  - runtime = vega.parse(vgSpec, opt.config); // may throw an Error if parsing fails
  - } catch (err) {
  - return Promise.reject(err);
  - }
  + const runtime = vega.parse(vgSpec, opt.config); // may throw an Error if parsing fails
  const view = new vega.View(runtime)
  .renderer(renderer)
  @@ -174,6 +170,9 @@ const embed: Export = (el: Element, spec: any, opt: Options) => {
  }
  return Promise.resolve({view, spec});
  + } catch (err) {
  + return Promise.reject(err);
  + }
  };
  function viewSource(source: string, sourceHeader: string, sourceFooter: string) {
  