Bug 140620 Chart scripting errors are ignored
Write a chart with an invalid script, the execution simply ignores the script. This makes it difficult to debug scripting. The error message is also not precise and needs improvements.
engine/org.eclipse.birt.report.engine.emitter.html/src/org/eclipse/birt/report/engine/emitter/html/HTMLReportEmitter.java
)
		{
			ttribute( HTMLTags.ATTR_CLASS, reportStyleName );
		}
	}
	private void appendErrorMessage( int index, ElementExceptionInfo info )
	{
		String errorId = "document.getElementById('error_detail" + index + "')";
		String errorIcon = "document.getElementById('error_icon" + index + "')";
		String onClick = "" + errorId + ".style.display == 'none') { "
				+ errorIcon + ".innerHTML = '-'; " + errorId
				+ ".style.display = 'block'; }" + "else { " + errorIcon
				+ ".innerHTML = '+'; " + errorId + ".style.display = 'none'; }";
		EngineResourceHandle rc = EngineResourceHandle.getInstance( );
		writer.writeCode( "			<div>" );
		writer.writeCode( "				<span id=\"error_icon" + index
				+ "\"  style=\"cursor:pointer\" onclick=\"" + onClick
				+ "\" > + <span>" );
		writer.writeCode( "				<span  id=\"error_title\">" );
		writer.text( rc.getMessage( MessageConstants.REPORT_ERROR_MESSAGE,
				new Object[]{info.getType( ), info.getElementInfo( )} ), false );
		writer.writeCode( "<span>" );
		writer.writeCode( "				<pre id=\"error_detail" + index
				+ "\" style=\"display:none;\" >" );
		ArrayList errorList = info.getErrorList( );
		ArrayList countList = info.getCountList( );
		for ( int i = 0; i < errorList.size( ); i++ )
		{
			BirtException ex = (BirtException) errorList.get( i );
			String messageTitle = rc.getMessage(
					MessageConstants.REPORT_ERROR_ID, new Object[]{
							new Integer( i ), ex.getErrorCode( ),
							countList.get( i )} );
			String detailTag = rc
					.getMessage( MessageConstants.REPORT_ERROR_DETAIL );
			String messageBody = getDetailMessage( ex );
			boolean indent = writer.isIndent( );
			writer.setIndent( false );
			writer.text( messageTitle, false );
			writer.writeCode( "\r\n" );
			writer.text( detailTag, false );
			writer.text( messageBody, false );
			writer.setIndent( indent );
		}
		writer.writeCode( "				<pre>" );
		writer.writeCode( "		<div>" ); 
	}
	private String getDetailMessage( Throwable t )
	{
		StringWriter out = new Strin