Skip to content

Commit dc7eb66

Browse files
committed
1 parent 09fc678 commit dc7eb66

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@
2222
- #159 generated pid file not get deleted when app process is killed
2323
- #157 SEO support on routing
2424
- #156 Compile error is not displayed at dev mode
25-
- #153 When `@NotNull` used along with `@DbBind` it shall return 404 if binding failed
25+
- #153 When `@NotNull` used along with `@DbBind` it shall return 404 if binding failed
2626
- #152 Allow annotation based interceptor class to be registered as global interceptor
27+
- #124 Improve error reporting on "Unknown accept content type"
2728
2829
- #136 Allow `@With` annotation to be used on specific handler method
2930

src/main/java/act/view/RenderAny.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,16 @@ public void apply(H.Request req, H.Response resp) {
5959
public void apply(ActionContext context) {
6060
H.Format fmt = context.accept();
6161
if (fmt == UNKNOWN) {
62-
throw E.unsupport("Unknown accept content type");
62+
H.Request req = context.req();
63+
H.Method method = req.method();
64+
String methodInfo = S.concat(method.name(), " method to ");
65+
String acceptHeader = req.header(H.Header.Names.ACCEPT);
66+
throw E.unsupport(S.concat(
67+
"Unknown accept content type(",
68+
acceptHeader,
69+
"): ",
70+
methodInfo,
71+
req.url()));
6372
}
6473
Result result = null;
6574
if (JSON == fmt) {

0 commit comments

Comments
 (0)