Skip to content

Commit

Permalink
refactor: add JsError to SpecifierError
Browse files Browse the repository at this point in the history
  • Loading branch information
crowlKats committed Nov 22, 2024
1 parent 9e5176f commit 3cdd4b9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rs-lib/src/specifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
use thiserror::Error;
use url::Url;

#[derive(Debug, Error, Clone, PartialEq, Eq)]
#[derive(Debug, Error, Clone, PartialEq, Eq, deno_error::JsError)]
pub enum SpecifierError {
// don't make this error a source because it's short
// and that causes unnecessary verbosity
#[class(inherit)]
#[error("invalid URL: {0}")]
InvalidUrl(url::ParseError),
#[class(type)]
#[error(
"Relative import path \"{specifier}\" not prefixed with / or ./ or ../"
)]
Expand Down

0 comments on commit 3cdd4b9

Please sign in to comment.