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

fix(patch): Use String(reflecting: error) for printing errors #290

Merged
merged 3 commits into from
Dec 5, 2024

Conversation

MahdiBM
Copy link
Contributor

@MahdiBM MahdiBM commented Oct 8, 2024

Description

A few (mostly server side) packages like PostgresNIO have a generic description in their errors, while providing the full error info in debugDescription.
Using String(reflecting: error) we can make sure the debugDescription is preferred when transforming the error into an String.

Sample error:

Benchmark MyBenchmark failed with PostgresDecodingError – Generic description to prevent accidental leakage of sensitive data. For debugging details, use String(reflecting: error).

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Minimal checklist:

  • I have performed a self-review of my own code
  • I have added DocC code-level documentation for any public interfaces exported by the package
  • I have added unit and/or integration tests that prove my fix is effective or that my feature works

@hassila hassila requested a review from lehtihet November 18, 2024 09:01
Copy link

codecov bot commented Nov 21, 2024

Codecov Report

Attention: Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.

Project coverage is 71.41%. Comparing base (df62bb1) to head (59933a6).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
.../Benchmark/Benchmark+ConvenienceInitializers.swift 0.00% 2 Missing ⚠️
Sources/Benchmark/Benchmark.swift 0.00% 2 Missing ⚠️
Sources/Benchmark/BenchmarkRunner.swift 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #290   +/-   ##
=======================================
  Coverage   71.41%   71.41%           
=======================================
  Files          32       32           
  Lines        3791     3791           
=======================================
  Hits         2707     2707           
  Misses       1084     1084           
Files with missing lines Coverage Δ
Sources/Benchmark/BenchmarkRunner.swift 59.09% <0.00%> (ø)
.../Benchmark/Benchmark+ConvenienceInitializers.swift 0.00% <0.00%> (ø)
Sources/Benchmark/Benchmark.swift 70.73% <0.00%> (ø)
Files with missing lines Coverage Δ
Sources/Benchmark/BenchmarkRunner.swift 59.09% <0.00%> (ø)
.../Benchmark/Benchmark+ConvenienceInitializers.swift 0.00% <0.00%> (ø)
Sources/Benchmark/Benchmark.swift 70.73% <0.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update df62bb1...59933a6. Read the comment docs.

Copy link
Contributor

@lehtihet lehtihet left a comment

Choose a reason for hiding this comment

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

Good idea to provide more detailed error messages.

@lehtihet lehtihet merged commit 51fffb6 into ordo-one:main Dec 5, 2024
14 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants