rolldown_error 0.1.0

rolldown_error
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#[derive(Debug)]
pub struct NapiError(pub napi::Error);

impl super::BuildEvent for NapiError {
  fn kind(&self) -> crate::EventKind {
    crate::EventKind::NapiError
  }

  fn message(&self, _opts: &crate::DiagnosticOptions) -> String {
    format!("N-API error: {}", self.0)
  }

  #[cfg(feature = "napi")]
  fn as_napi_error(&self) -> Option<&napi::Error> {
    Some(&self.0)
  }
}