In URI_Templates, there are lots of fail(ex.getMessage()) where ex is the Java exception thrown. This is not translated to JavaScript nicely, and should be either removed from the Java URI_Templates (so it just takes an exception) of fixed in the translation.