-
Notifications
You must be signed in to change notification settings - Fork 35
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
Conversation
None => { | ||
return StatusCode::BAD_REQUEST; | ||
return (StatusCode::BAD_REQUEST, | ||
Json(json!({"error": "Missing traceparent header"}))); |
There was a problem hiding this comment.
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")); |
There was a problem hiding this comment.
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.
Description
Type of change
Fixes: #issue_number