Skip to content

Commit e813a0e

Browse files
authored
Merge pull request #7 from jeancsanchez/develop
Add Conflict error (409)
2 parents 46eadff + a7ec04d commit e813a0e

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

errorinterceptor/src/main/java/br/com/jeancsanchez/restinterceptor/RestErrorInterceptor.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class RestErrorInterceptor : Interceptor {
2222
403 -> throw Forbidden
2323
404 -> throw NotFound
2424
405 -> throw MethodNotAllowed
25+
409 -> throw Conflict
2526
500 -> throw InternalServerError
2627
502 -> throw BadGateway
2728
503 -> throw ServiceUnavailable
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package br.com.jeancsanchez.restinterceptor.errors
2+
3+
/**
4+
* The server, while acting as a gateway or proxy, received an invalid response from the upstream
5+
* server it accessed in attempting to fulfill the request.
6+
* <a href="https://www.restapitutorial.com/httpstatuscodes.html">restapitutorial.com <a/>
7+
*
8+
* @author Jean Carlos (Github: @jeancsanchez)
9+
* @date 25/06/19.
10+
* Jesus is alive!
11+
*/
12+
object Conflict : Error(409, "Conflict")

0 commit comments

Comments
 (0)