Skip to content

Commit 4bf1b55

Browse files
committed
address PR feedback
1 parent c4f3f4e commit 4bf1b55

File tree

2 files changed

+10
-20
lines changed

2 files changed

+10
-20
lines changed

src/main/java/feign/error/ErrorHandling.java

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
package feign.error;
1515

1616
import feign.Response;
17-
1817
import java.lang.annotation.ElementType;
1918
import java.lang.annotation.Inherited;
2019
import java.lang.annotation.Retention;
@@ -30,18 +29,9 @@
3029
Class<? extends Exception> defaultException() default NO_DEFAULT.class;
3130

3231
final class NO_DEFAULT extends Exception {
33-
34-
/**
35-
* For backward compatibility.
36-
*/
37-
@Deprecated
38-
public NO_DEFAULT() {
39-
}
40-
41-
@FeignExceptionConstructor
42-
public NO_DEFAULT(@ResponseBody Response response) {
43-
super("Endpoint responded with " + response.status() + ", reason: " + response.reason());
44-
}
45-
32+
@FeignExceptionConstructor
33+
public NO_DEFAULT(@ResponseBody Response response) {
34+
super("Endpoint responded with " + response.status() + ", reason: " + response.reason());
35+
}
4636
}
4737
}

src/test/java/feign/error/AnnotationErrorDecoderExceptionConstructorsTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,16 +142,16 @@ public void test() throws Exception {
142142
@Test
143143
public void testIfExceptionIsNotInTheList() throws Exception {
144144
AnnotationErrorDecoder decoder = AnnotationErrorDecoder
145-
.builderFor(TestClientInterfaceWithDifferentExceptionConstructors.class)
146-
.withResponseBodyDecoder(new OptionalDecoder(new Decoder.Default()))
147-
.build();
145+
.builderFor(TestClientInterfaceWithDifferentExceptionConstructors.class)
146+
.withResponseBodyDecoder(new OptionalDecoder(new Decoder.Default()))
147+
.build();
148148

149149
Exception genericException = decoder.decode(feignConfigKey("method1Test"),
150-
testResponse(-1, NON_NULL_BODY, NON_NULL_HEADERS));
150+
testResponse(-1, NON_NULL_BODY, NON_NULL_HEADERS));
151151

152152
assertThat(genericException)
153-
.isInstanceOf(ErrorHandling.NO_DEFAULT.class)
154-
.hasMessage("Endpoint responded with -1, reason: null");
153+
.isInstanceOf(ErrorHandling.NO_DEFAULT.class)
154+
.hasMessage("Endpoint responded with -1, reason: null");
155155
}
156156

157157
interface TestClientInterfaceWithDifferentExceptionConstructors {

0 commit comments

Comments
 (0)