summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2012-12-10 09:48:28 +0000
committerVaadin Code Review <review@vaadin.com>2012-12-10 09:48:28 +0000
commita24ae63c0068bf7eb9bdc9c662c7d9eb3760861f (patch)
tree4d46c8f82c8d31d5b276edb111224b3b7fd448ed /client
parenteb0a22d5ac67808a89e046f81b7032955d41be3c (diff)
parent467edbbe2042a6ab4885e7bc0906415c529b6235 (diff)
downloadvaadin-framework-a24ae63c0068bf7eb9bdc9c662c7d9eb3760861f.tar.gz
vaadin-framework-a24ae63c0068bf7eb9bdc9c662c7d9eb3760861f.zip
Merge "Better error messages for unknown legacy variable types (#10481)"
Diffstat (limited to 'client')
-rw-r--r--client/src/com/vaadin/client/communication/JsonEncoder.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/client/src/com/vaadin/client/communication/JsonEncoder.java b/client/src/com/vaadin/client/communication/JsonEncoder.java
index 07908c8147..162becf8ff 100644
--- a/client/src/com/vaadin/client/communication/JsonEncoder.java
+++ b/client/src/com/vaadin/client/communication/JsonEncoder.java
@@ -138,7 +138,20 @@ public class JsonEncoder {
Object value = uidlValue.getValue();
JSONArray jsonArray = new JSONArray();
- jsonArray.set(0, new JSONString(getTransportType(value)));
+ String transportType = getTransportType(value);
+ if (transportType == null) {
+ /*
+ * This should not happen unless you try to send an unsupported type
+ * in a legacy variable change from the client to the server.
+ */
+ String valueType = null;
+ if (value != null) {
+ valueType = value.getClass().getName();
+ }
+ throw new IllegalArgumentException("Cannot encode object of type "
+ + valueType);
+ }
+ jsonArray.set(0, new JSONString(transportType));
jsonArray.set(1, encode(value, true, connection));
return jsonArray;