Skip to content

Commit

Permalink
feat: add non_exhaustive to error enums
Browse files Browse the repository at this point in the history
  • Loading branch information
gadomski committed Jul 11, 2023
1 parent 5678f13 commit 8ecce31
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions stac-api/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use thiserror::Error;

/// Crate-specific error enum.
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum Error {
/// Queries cannot be converted to strings.
#[error("cannot convert queries to strings")]
Expand Down
1 change: 1 addition & 0 deletions stac-async/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use url::Url;

/// Crate-specific error type.
#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum Error {
/// Cannot download assets for the given value.
#[error("cannot download")]
Expand Down
1 change: 1 addition & 0 deletions stac-cli/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use stac::Value;
use thiserror::Error;

#[derive(Error, Debug)]
#[non_exhaustive]
pub enum Error {
#[error("unsupported STAC type for downloading assets")]
CannotDownload(Value),
Expand Down
1 change: 1 addition & 0 deletions stac-validate/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use url::Url;

/// Crate-specific error type.
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum Error {
/// Cannot resolve schemas with a json-schema scheme.
#[error("cannot resolve json-schema scheme: {0}")]
Expand Down
1 change: 1 addition & 0 deletions stac/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use thiserror::Error;

/// Error enum for crate-specific errors.
#[derive(Error, Debug)]
#[non_exhaustive]
pub enum Error {
/// [chrono::ParseError]
#[error(transparent)]
Expand Down

0 comments on commit 8ecce31

Please sign in to comment.