orhun / rustypaste

A minimal file upload/pastebin service.
https://blog.orhun.dev/blazingly-fast-file-sharing
MIT License
726 stars 46 forks source link

refactor(server): use more specific HTTP status codes #262

Closed tessus closed 4 months ago

tessus commented 4 months ago

Description

This change returns a more appropriate status code in 2 cases instead of a generic 500 code:

Motivation and Context

closes #261

How Has This Been Tested?

Changelog Entry

### Changed

- Return appropriate HTTP status code instead of 500

Types of Changes

Checklist:

codecov-commenter commented 4 months ago

Codecov Report

Attention: Patch coverage is 60.00000% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 82.35%. Comparing base (4987cfe) to head (075fc84).

Files Patch % Lines
src/paste.rs 60.00% 2 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #262 +/- ## ========================================== + Coverage 82.32% 82.35% +0.02% ========================================== Files 11 11 Lines 1228 1224 -4 ========================================== - Hits 1011 1008 -3 + Misses 217 216 -1 ``` | [Flag](https://app.codecov.io/gh/orhun/rustypaste/pull/262/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Orhun+Parmaks%C4%B1z) | Coverage Δ | | |---|---|---| | [unit-tests](https://app.codecov.io/gh/orhun/rustypaste/pull/262/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Orhun+Parmaks%C4%B1z) | `82.35% <60.00%> (+0.02%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Orhun+Parmaks%C4%B1z#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.