Skip to content

Commit

Permalink
fix: Update error code for check failure (#1705)
Browse files Browse the repository at this point in the history
Co-authored-by: Avery Harnish <[email protected]>
  • Loading branch information
david-castaneda and EverlastingBugstopper authored Aug 10, 2023
1 parent 1b75dcb commit 584256e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions docs/source/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,4 +319,8 @@ This error occurs when a schema file has lint rule violations.

The schema you're linting has violated some of the rules configured for your graph. Fix the errors and re-run the lint command to verify the violations have been addressed. See [the docs](https://www.apollographql.com/docs/graphos/delivery/schema-linter/) for more information about schema linting.

### E043

This error occurs when a build, operation, and/or linter check step fails due to a change in the schema.

Please view the check in [Apollo Studio](https://studio.apollographql.com/) at the provided link to see the failure reason. You can read more about client checks [here](https://www.apollographql.com/docs/studio/schema-checks/).
2 changes: 1 addition & 1 deletion src/command/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,7 @@ mod tests {
},
"error": {
"message": "The changes in the schema you proposed caused operation and linter checks to fail.",
"code": "E042",
"code": "E043",
}
});
assert_json_eq!(expected_json, actual_json);
Expand Down
5 changes: 5 additions & 0 deletions src/error/metadata/code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ pub enum RoverErrorCode {
E040,
E041,
E042,
E043,
}

impl Display for RoverErrorCode {
Expand Down Expand Up @@ -229,6 +230,10 @@ impl RoverErrorCode {
RoverErrorCode::E042,
include_str!("./codes/E042.md").to_string(),
),
(
RoverErrorCode::E043,
include_str!("./codes/E043.md").to_string(),
),
];
contents.into_iter().collect()
}
Expand Down
3 changes: 3 additions & 0 deletions src/error/metadata/codes/E043.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This error occurs when a build, operation, and/or linter check step fails due to a change in the schema.

Please view the check in [Apollo Studio](https://studio.apollographql.com/) at the provided link to see the failure reason. You can read more about schema checks [here](https://www.apollographql.com/docs/studio/schema-checks/).
2 changes: 1 addition & 1 deletion src/error/metadata/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ impl From<&mut anyhow::Error> for RoverErrorMetadata {
check_response: _,
} => (
Some(RoverErrorSuggestion::FixCheckFailures),
Some(RoverErrorCode::E042),
Some(RoverErrorCode::E043),
),
RoverClientError::LintFailures { lint_response: _ } => (
Some(RoverErrorSuggestion::FixLintFailure),
Expand Down

0 comments on commit 584256e

Please sign in to comment.