Skip to content

Commit b6fbf73

Browse files
authored
publicize BuildError type and BuildErrorType enum (apollographql#309)
follow-up to: apollographql/federation-rs#276 allows matching on the `BuildErrorType` enum
1 parent 3866a15 commit b6fbf73

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

apollo-federation-types/src/build/error.rs

+4
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ impl BuildError {
5151
pub fn get_code(&self) -> Option<String> {
5252
self.code.clone()
5353
}
54+
55+
pub fn get_type(&self) -> BuildErrorType {
56+
self.r#type.clone()
57+
}
5458
}
5559

5660
#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]

apollo-federation-types/src/build/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ mod subgraph_definition;
55

66
/// The type representing the result of a supergraph build (for any version)
77
pub type BuildResult = std::result::Result<BuildOutput, BuildErrors>;
8-
pub use error::{BuildError, BuildErrors};
8+
pub use error::{BuildError, BuildErrorType, BuildErrors};
99
pub use hint::BuildHint;
1010
pub use output::BuildOutput;
1111
pub use subgraph_definition::SubgraphDefinition;

0 commit comments

Comments
 (0)