|
@@ -228,7 +228,11 @@ public class WebSocketServerEndpoint {
|
|
|
for (int i = 0; i < parameterTypes.length; i++) {
|
|
|
Class<?> curType = parameterTypes[i];
|
|
|
if (hasMessageParam && i == messageParamIndex) {
|
|
|
- args[i] = JsonUtil.fromJson(message, curType);
|
|
|
+ try {
|
|
|
+ args[i] = JsonUtil.fromJson(message, curType);
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new StatusException("508", "fail to parse message.");
|
|
|
+ }
|
|
|
continue;
|
|
|
}
|
|
|
if (curType.equals(User.class)) {
|