Closed MalteEbner closed 5 months ago
Attention: Patch coverage is 33.33333%
with 22 lines
in your changes are missing coverage. Please review.
Project coverage is 81.78%. Comparing base (
9bda4ee
) to head (f5f8f90
).
Files | Patch % | Lines |
---|---|---|
lightly/api/swagger_rest_client.py | 29.03% | 22 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Update after discussion with Jeremy:
Because lightly is a library that might be used by other python code (e.g. customers integrates it into their own python pipeline), we should not change global functions or rely on them being set to something special. Examples:
Thus the idea is to keep the direction of this draft: Make the error message formatting nicer, but don't mess with global functions and thus keep the traceback. However, we should
PrettyPrintApiException
for all ApiException
Wdyt? @guarin
Description (version 2):
Change
ApiException
toPrettyPrintApiException(ApiException)
, which prints it much more nicely (formatting, print relevant part in bold and red). I kept it inheriting fromApiException
to ensure that the calling code can still catch it if needed.Effects
1) Shortens the stacktrace a bit 2) Prints the ApiException more nicely.
Stacktrace still there
We will not overwrite the
sys.excepthook
, see discussion with Guarin here, as it is too hacky and might cause problems among users of the library.Screenshots