Skip to content

Commit a7ec04d

Browse files
committed
Add Conflict error (409)
1 parent 4edb76d commit a7ec04d

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

+1
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
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)