swc_core::plugin::errors

Static HANDLER

pub static HANDLER: ScopedKey<Handler>
Available on (crate features __common_plugin_transform or __plugin_transform_host) and (crate features __common_plugin_transform or __css_plugin_transform or __ecma_plugin_transform) only.
Expand description

Used for error reporting in transform.

This should be only used for errors from the api which does not returning errors.

e.g.

  • parser should not use this.
  • transforms should use this to report error, as it does not return Result.

See Handler for actual usage examples.