getting record contents gives JS exception

I have a Record that I have manually created on the client side (new Record()), and have set a few attributes on it.

When I try to save it (using DataSource.addData, it throws an exception.)

When I try to analyze the contents of it (via SC.logEcho(record.getJsObj()), it throws a JS exception.

Here is the top part of the later exception:

com.google.gwt.core.client.JavaScriptException: (null): null
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:195)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:120)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:507)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:284)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
    at com.smartgwt.client.util.SC.logEcho(SC.java)
    at com.nolmecolindor.indi.engine.client.ui.reports.ElementPresenter.save(ElementPresenter.java:423)

I know that the JavaScriptObject which the record.getJsObj() returns is not null, and if I call getAttributes() on the record, I can see that it has the intended attributes.

What could be wrong here?

Here is the JS stack from IE

12:07:33.638:MUP8:WARN:Log:Error:
    'Object doesn't support this property or method'
    in http://localhost:8888/orgtel/sc/modules/ISC_DataBinding.js
    at line 59
    Comm.$36t(_1=>"ELEMENT_TYPE", _2=>DATA, _3=>".operations[0].values.ELEMENT_TYPE", _4=>Obj, _5=>null, _6=>false)
    Comm.$ew(_1=>"ELEMENT_TYPE", _2=>DATA, _3=>null, _4=>Obj)
    ** recursed on Comm.$36t

Problem solved

As clearly visible from the IE JS stack trace, the problem was that I wrote in an enum directly, instead of the string value of it.

(However, I wonder why is IE needed to get a meaningful error message…)

It would also help if the exception was generated when I was trying to write illegal data, and not when I am trying to read it out, possibly ages later…