Skip to content

Commit aa2e0a3

Browse files
committed
Unexpected mime type should be a ConversionException.
1 parent b1e4330 commit aa2e0a3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

retrofit-converters/wire/src/main/java/retrofit/converter/WireConverter.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public WireConverter(Wire wire) {
3737
}
3838

3939
if (!MIME_TYPE.equalsIgnoreCase(body.mimeType())) {
40-
throw new IllegalArgumentException("Expected a proto but was: " + body.mimeType());
40+
throw new ConversionException("Expected a proto but was: " + body.mimeType());
4141
}
4242

4343
InputStream in = null;

retrofit-converters/wire/src/test/java/retrofit/converter/WireConverterTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public final class WireConverterTest {
6464
try {
6565
converter.fromBody(decodeBase64("////", "yummy/bytes"), Person.class);
6666
fail();
67-
} catch (IllegalArgumentException e) {
67+
} catch (ConversionException e) {
6868
assertThat(e).hasMessage("Expected a proto but was: yummy/bytes");
6969
}
7070
}

0 commit comments

Comments
 (0)