util: Move error message formatting of NonFatalCheckError to cpp #25112

pull maflcko wants to merge 1 commits into bitcoin:master from maflcko:2205-err-impl-🗡 changing 3 files +22 −16
  1. maflcko commented at 7:19 AM on May 12, 2022: member

    This allows to strip down the header file.

  2. maflcko added the label Refactoring on May 12, 2022
  3. maflcko force-pushed on May 12, 2022
  4. maflcko force-pushed on May 12, 2022
  5. DrahtBot cross-referenced this on May 24, 2022 from issue refactor: Split util/system into exception, shell, and fs-specific files by Empact
  6. DrahtBot commented at 1:39 PM on May 24, 2022: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Count Reviewers
    ACK 2 aureleoules, hebasto
    Concept ACK 1 laanwj

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    No conflicts as of last run.

  7. DrahtBot cross-referenced this on May 28, 2022 from issue Handle invalid hex encoding in ParseHex by maflcko
  8. DrahtBot cross-referenced this on May 28, 2022 from issue refactor: Make FEELER_SLEEP_WINDOW type safe (std::chrono) by maflcko
  9. in src/util/check.h:8 in fa13e2f365 outdated
       4 | @@ -5,30 +5,23 @@
       5 |  #ifndef BITCOIN_UTIL_CHECK_H
       6 |  #define BITCOIN_UTIL_CHECK_H
       7 |  
       8 | -#if defined(HAVE_CONFIG_H)
    


    laanwj commented at 12:33 PM on May 30, 2022:

    Any idea what this bitcoin-config.h was needed for before?


    maflcko commented at 12:39 PM on May 30, 2022:

    This was added without explanation in commit 691c817b340 by @ryanofsky


    ryanofsky commented at 8:49 PM on May 30, 2022:

    This was added without explanation in commit 691c817 by @ryanofsky

    I added the include there to define the PACKAGE_BUGREPORT macro referenced below (it was probably needed previously, but not obvious because of an earlier include)


    maflcko commented at 7:12 AM on May 31, 2022:

    Thx.

    In this pull, I moved this to the cpp file, as the PACKAGE_BUGREPORT is only used there. iwyu is also happy on the changes here: https://cirrus-ci.com/task/4985805499269120?logs=ci#L7190

  10. laanwj commented at 12:33 PM on May 30, 2022: member

    Concept ACK

  11. DrahtBot cross-referenced this on May 31, 2022 from issue refactor: Add LIFETIMEBOUND / -Wdangling-gsl to Assert() by maflcko
  12. maflcko force-pushed on May 31, 2022
  13. DrahtBot cross-referenced this on Jun 9, 2022 from issue refactor: add most of src/util to iwyu by fanquake
  14. DrahtBot cross-referenced this on Jul 1, 2022 from issue [kernel 3c/n] Decouple validation cache initialization from `ArgsManager` by dongcarl
  15. DrahtBot cross-referenced this on Jul 6, 2022 from issue fuzz: add low-level target for txorphanage by chinggg
  16. DrahtBot added the label Needs rebase on Jul 7, 2022
  17. maflcko force-pushed on Jul 7, 2022
  18. DrahtBot removed the label Needs rebase on Jul 7, 2022
  19. DrahtBot added the label Needs rebase on Jul 12, 2022
  20. maflcko force-pushed on Jul 12, 2022
  21. DrahtBot removed the label Needs rebase on Jul 12, 2022
  22. maflcko force-pushed on Sep 12, 2022
  23. DrahtBot cross-referenced this on Oct 12, 2022 from issue ci: Integrate `bitcoin-tidy` clang-tidy plugin by fanquake
  24. DrahtBot added the label Needs rebase on Nov 3, 2022
  25. maflcko force-pushed on Nov 14, 2022
  26. maflcko force-pushed on Nov 14, 2022
  27. DrahtBot removed the label Needs rebase on Nov 14, 2022
  28. maflcko cross-referenced this on Nov 16, 2022 from issue Add `UNREACHABLE` macro by hebasto
  29. hebasto commented at 9:33 AM on November 16, 2022: member

    Concept ACK.

  30. in src/util/check.cpp:10 in fadbc71e01 outdated
       6 | +#if defined(HAVE_CONFIG_H)
       7 | +#include <config/bitcoin-config.h>
       8 | +#endif
       9 |  
      10 |  #include <tinyformat.h>
      11 | +#include <util/check.h>
    


    hebasto commented at 11:06 AM on November 16, 2022:

    nit: Usually we put the header, which is directly related to the source file, at the top of the headers.


    maflcko commented at 11:24 AM on November 16, 2022:

    yes, done

  31. in src/util/check.h:24 in fadbc71e01 outdated
      31 |  T&& inline_check_non_fatal(LIFETIMEBOUND T&& val, const char* file, int line, const char* func, const char* assertion)
      32 |  {
      33 |      if (!(val)) {
      34 | -        throw NonFatalCheckError(
      35 | -            format_internal_error(assertion, file, line, func, PACKAGE_BUGREPORT));
      36 | +        throw NonFatalCheckError{assertion, file, line, func};
    


    hebasto commented at 11:07 AM on November 16, 2022:

    nit: The #24812 (review) could be addressed as well here.


    maflcko commented at 11:23 AM on November 16, 2022:

    thx, done

  32. hebasto approved
  33. hebasto commented at 11:07 AM on November 16, 2022: member

    ACK fadbc71e010b32e23f158bd95cdf2f26c870e11f, I have reviewed the code and it looks OK, I agree it can be merged.

  34. util: Move error message formatting of NonFatalCheckError to cpp
    This allows to strip down the header file
    2222ec71fd
  35. maflcko force-pushed on Nov 16, 2022
  36. hebasto approved
  37. hebasto commented at 11:58 AM on November 16, 2022: member

    re-ACK 2222ec71fdf573a15bb593fc0dd42d2d28ca5449, only rebased and suggested changes since my recent review.

  38. aureleoules approved
  39. aureleoules commented at 12:19 PM on November 16, 2022: member

    ACK 2222ec71fdf573a15bb593fc0dd42d2d28ca5449

  40. maflcko merged this on Nov 16, 2022
  41. maflcko closed this on Nov 16, 2022

  42. maflcko deleted the branch on Nov 16, 2022
  43. sidhujag referenced this in commit 6031a314c2 on Nov 16, 2022
  44. bitcoin locked this on Mar 6, 2024

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-20 06:53 UTC