jsWriter.startObject();
jsWriter.startProperty("error");
jsWriter.outStringLiteral(strError);
jsWriter.endProperty();
jsWriter.startProperty("errornr");
jsWriter.outIntLiteral(nError);
jsWriter.endProperty();
if (ex != null) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
ex.printStackTrace(pw);