tracehubpm / pmo

Project registry, facilities and its home
MIT License
4 stars 0 forks source link

Can be replaced with ResponseStatusException #80

Closed l3r8yJ closed 6 months ago

l3r8yJ commented 6 months ago

More convenient way is RSE. It would be automatically handled by Spring

https://github.com/tracehubpm/pmo/blob/6ba5195fb667ab6beb67af340942bcd67699c469/src/main/java/git/tracehub/pmo/exception/ResourceAlreadyExistsException.java#L32

https://github.com/tracehubpm/pmo/blob/6ba5195fb667ab6beb67af340942bcd67699c469/src/main/java/git/tracehub/pmo/exception/ResourceNotFoundException.java#L32

Can be replaced with

public class SomeExcpetion extends ResponseStatusException { 

Response:

HTTP/1.1 404
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Date: Sat, 26 Dec 2020 19:38:09 GMT

{
    "timestamp": "2020-12-26T19:38:09.426+00:00",
    "status": 404,
    "error": "Not Found",
    "path": "/some/path"
}
h1alexbel commented 6 months ago

@l3r8yJ thanks for bug report, @hizmailovich take a look, please