Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review Change Router #43

Merged
merged 4 commits into from
Sep 23, 2024
Merged

Review Change Router #43

merged 4 commits into from
Sep 23, 2024

Conversation

ruokun-niu
Copy link
Contributor

Description

  • Replaces any occurrences of "Change Service" or "change-svc" with change router
  • Improved Error handling in the change router

Type of change

  • This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Drasi (issue link optional).

Fixes: #issue_number

None => {
return StatusCode::BAD_REQUEST;
return (StatusCode::BAD_REQUEST,
Json(json!({"error": "Missing traceparent header"})));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if we should fail the whole request if the trace header is missing or invalid.

@@ -355,6 +478,8 @@ async fn process_changes(
}
}
}
} else {
return Err(Box::<dyn std::error::Error>::from("Expected changes to be an array"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would put the error check in the beginning of the function and exit early... It's just easier to read that way.

@ruokun-niu ruokun-niu merged commit d9ab0d1 into main Sep 23, 2024
32 checks passed
@danielgerlag danielgerlag deleted the review-change-router branch September 26, 2024 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants