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

Remove RETURN_ERROR macro #901

Merged
merged 1 commit into from
Jan 13, 2022
Merged

Remove RETURN_ERROR macro #901

merged 1 commit into from
Jan 13, 2022

Conversation

pudelkoM
Copy link
Member

@pudelkoM pudelkoM commented Jan 13, 2022

This PR replaces the usage of RETURN_ERROR() with return MAKE_ERROR(). RETURN_ERROR seems to be part of an older style of error handling that has not been present in the original Google code drop, other recent Google projects or Abseil. In Stratum, only contributed code reintroduced the macro into code. Replacement is automated and should not change any logic or program behavior.
This change also brings us closer to the Abseil style:

  // encounter error
  if (error condition) {
    return absl::InvalidArgumentError("bad mode");
  }

@pudelkoM pudelkoM force-pushed the remove-return-error-macro branch 3 times, most recently from ceae75e to 819de89 Compare January 13, 2022 18:52
@codecov
Copy link

codecov bot commented Jan 13, 2022

Codecov Report

Merging #901 (994c1bd) into main (849cdd6) will increase coverage by 0.00%.
The diff coverage is 18.82%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #901   +/-   ##
=======================================
  Coverage   78.79%   78.80%           
=======================================
  Files         336      336           
  Lines       30130    30131    +1     
=======================================
+ Hits        23742    23744    +2     
+ Misses       6388     6387    -1     
Impacted Files Coverage Δ
stratum/glue/status/status_macros.h 91.42% <ø> (ø)
stratum/hal/lib/barefoot/bfrt_pre_manager.cc 82.67% <0.00%> (-0.42%) ⬇️
stratum/hal/lib/barefoot/bfrt_table_manager.cc 25.19% <0.00%> (-0.24%) ⬇️
stratum/hal/lib/bcm/bcm_node.cc 58.68% <0.00%> (-0.11%) ⬇️
stratum/hal/lib/common/admin_utils.cc 0.00% <0.00%> (ø)
stratum/hal/lib/np4intel/np4_chassis_manager.cc 42.36% <0.00%> (ø)
stratum/hal/lib/p4/p4_info_manager.cc 81.94% <0.00%> (ø)
stratum/hal/lib/phal/onlp/onlp_sfp_configurator.cc 49.59% <0.00%> (ø)
stratum/hal/lib/phal/sfp_adapter.cc 23.37% <0.00%> (ø)
stratum/lib/security/certificate.cc 89.41% <0.00%> (ø)
... and 13 more

@pudelkoM pudelkoM merged commit 0e2898a into main Jan 13, 2022
@pudelkoM pudelkoM deleted the remove-return-error-macro branch January 13, 2022 22:41
ffoulkes added a commit to ipdk-io/stratum-dev that referenced this pull request Jan 13, 2024
- Change applied independently several months ago. This commit
  is for ancillary changes made as part of the same PR.

Signed-off-by: Derek G Foster <derek.foster@intel.com>
ffoulkes added a commit to ipdk-io/stratum-dev that referenced this pull request Jan 17, 2024
- Change applied independently several months ago. This commit
  is for ancillary changes made as part of the same PR.

Signed-off-by: Derek G Foster <derek.foster@intel.com>
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.

None yet

1 participant