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

pandaproxy: Invert error_code dependencies #4722

Merged
merged 5 commits into from
May 16, 2022

Commits on May 13, 2022

  1. pandaproxy: Add tests for error_code, error_condition comparisons

    Signed-off-by: Ben Pope <ben@redpanda.com>
    BenPope committed May 13, 2022
    Configuration menu
    Copy the full SHA
    c0cafa8 View commit details
    Browse the repository at this point in the history
  2. pandaproxy: Invert error_code dependencies

    There are currently several projects that depend on
    `v::pandaproxy_common` due to the conversion from
    `error_code` to `error_condition`, `reply_error_code`
    
    There are two ways to map to an `error_condition`
    1) Override `error_category::default_error_condition`
    2) Override `error_category::equivalent`
    
    1) Is what's current, but it requires a global
       `default_error_condition`, but `reply_error_code` is specific
       to pandaproxy, so the dependency works the wrong way.
    2) Could work, but only for checking equivalence of specific
       `std::error_code` with a specific `reply_error_code`, not
       for directly converting it.
    
    To break the dependency, overload `make_error_condition` that
    takes a `std::error_code`, and maps from `kafka::error_code` to
    `reply_error_condition` as before. Further commits will move code
    to break the dependencies.
    
    Implement replay_error_category::equivalent in terns of
    the new `make_error_condition`.
    
    Signed-off-by: Ben Pope <ben@redpanda.com>
    BenPope committed May 13, 2022
    Configuration menu
    Copy the full SHA
    c22d337 View commit details
    Browse the repository at this point in the history
  3. pandaproxy: Invert kafka::error_code dependency

    Move `make_error_code`  and `error_category` from pandaproxy to kafka.
    
    Signed-off-by: Ben Pope <ben@redpanda.com>
    BenPope committed May 13, 2022
    Configuration menu
    Copy the full SHA
    69bdfff View commit details
    Browse the repository at this point in the history
  4. pandaproxy: Invert parse::error_code dependency

    Move it from the pandaproxy::parse to pandaproxy.
    
    Change `exception_base` to use an `error_code`, which is the
    correct tool for passing around error information.
    
    Signed-off-by: Ben Pope <ben@redpanda.com>
    BenPope committed May 13, 2022
    Configuration menu
    Copy the full SHA
    3cbae3d View commit details
    Browse the repository at this point in the history
  5. pandaproxy: Invert json::error_code dependency

    Move it from the pandaproxy::json to pandaproxy.
    
    Signed-off-by: Ben Pope <ben@redpanda.com>
    BenPope committed May 13, 2022
    Configuration menu
    Copy the full SHA
    fd0eeb4 View commit details
    Browse the repository at this point in the history