Skip to content

Commit

Permalink
fix(error): fix PackageSpecError docs and help not printing
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Apr 18, 2023
1 parent e66936c commit f8e8e27
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions crates/nassun/src/error.rs
Expand Up @@ -19,6 +19,7 @@ pub enum NassunError {

/// Something went wrong while trying to parse a PackageArg
#[error(transparent)]
#[diagnostic(transparent)]
PackageSpecError(#[from] oro_package_spec::PackageSpecError),

#[error("{0}")]
Expand Down
7 changes: 6 additions & 1 deletion crates/oro-package-spec/src/error.rs
Expand Up @@ -4,11 +4,16 @@ use nom::error::{ContextError, ErrorKind, FromExternalError, ParseError};
use thiserror::Error;
use url::ParseError as UrlParseError;

/// An invalid package specifier was provided.
///
/// The syntax for package specifiers is documented here:
/// https://orogene.dev/book/guide/node_modules.html#specifier-syntax
#[derive(Debug, Error, Diagnostic)]
#[error("Error parsing package spec. {kind}")]
#[diagnostic(
code(package_spec::no_parse),
help("Please fix your spec. Go look up wherever they're documented idk.")
url(docsrs),
help("The syntax for package specifiers is documented here: https://orogene.dev/book/guide/node_modules.html#specifier-syntax")
)]
pub struct PackageSpecError {
pub input: String,
Expand Down

0 comments on commit f8e8e27

Please sign in to comment.