private void renderMessages() { String description = getDescription(); if (description != null && description.length() != 0) { messageWithoutStackTop = description; } else if (getCause() != null) { messageWithoutStackTop = "No error description was specified for this error; low-level message: " + getCause().getClass().getName() + ": " + getCause().getMessage(); } else { messageWithoutStackTop = "[No error description was available.]"; } String stackTopFew = getFTLInstructionStackTopFew(); if (stackTopFew != null) { message = messageWithoutStackTop + "\n\n" + _CoreAPI.ERROR_MESSAGE_HR + "\n" + FTL_INSTRUCTION_STACK_TRACE_TITLE + "\n" + stackTopFew + _CoreAPI.ERROR_MESSAGE_HR; messageWithoutStackTop = message.substring(0, messageWithoutStackTop.length()); // to reuse backing char[] } else { message = messageWithoutStackTop; } }
private void writeObject(ObjectOutputStream out) throws IOException, ClassNotFoundException { // These are calculated from transient fields, so this is the last chance to calculate them: getFTLInstructionStack(); getFTLInstructionStackTopFew(); getDescription(); calculatePosition(); getBlamedExpressionString(); out.defaultWriteObject(); }
/** * Constructs a TemplateException with both a description of the error * that occurred and the underlying Exception that caused this exception * to be raised. * * @param description the description of the error that occurred * @param cause the underlying <code>Exception</code> that caused this * exception to be raised */ public TemplateException(String description, Exception cause, Environment env) { super(getDescription(description, cause)); causeException = cause; this.env = env; if(env != null) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); env.outputInstructionStack(pw); pw.flush(); ftlInstructionStack = sw.toString(); } else { ftlInstructionStack = ""; } }
private void renderMessages() { String description = getDescription(); if (description != null && description.length() != 0) { messageWithoutStackTop = description; } else if (getCause() != null) { messageWithoutStackTop = "No error description was specified for this error; low-level message: " + getCause().getClass().getName() + ": " + getCause().getMessage(); } else { messageWithoutStackTop = "[No error description was available.]"; } String stackTopFew = getFTLInstructionStackTopFew(); if (stackTopFew != null) { message = messageWithoutStackTop + "\n\n" + _CoreAPI.ERROR_MESSAGE_HR + "\n" + FTL_INSTRUCTION_STACK_TRACE_TITLE + "\n" + stackTopFew + _CoreAPI.ERROR_MESSAGE_HR; messageWithoutStackTop = message.substring(0, messageWithoutStackTop.length()); // to reuse backing char[] } else { message = messageWithoutStackTop; } }
private void renderMessages() { String description = getDescription(); if (description != null && description.length() != 0) { messageWithoutStackTop = description; } else if (getCause() != null) { messageWithoutStackTop = "No error description was specified for this error; low-level message: " + getCause().getClass().getName() + ": " + getCause().getMessage(); } else { messageWithoutStackTop = "[No error description was available.]"; } String stackTopFew = getFTLInstructionStackTopFew(); if (stackTopFew != null) { message = messageWithoutStackTop + "\n\n" + _CoreAPI.ERROR_MESSAGE_HR + "\n" + FTL_INSTRUCTION_STACK_TRACE_TITLE + "\n" + stackTopFew + _CoreAPI.ERROR_MESSAGE_HR; messageWithoutStackTop = message.substring(0, messageWithoutStackTop.length()); // to reuse backing char[] } else { message = messageWithoutStackTop; } }
private void writeObject(ObjectOutputStream out) throws IOException, ClassNotFoundException { // These are calculated from transient fields, so this is the last chance to calculate them: getFTLInstructionStack(); getFTLInstructionStackTopFew(); getDescription(); calculatePosition(); getBlamedExpressionString(); out.defaultWriteObject(); }
private void writeObject(ObjectOutputStream out) throws IOException, ClassNotFoundException { // These are calculated from transient fields, so this is the last chance to calculate them: getFTLInstructionStack(); getFTLInstructionStackTopFew(); getDescription(); calculatePosition(); getBlamedExpressionString(); out.defaultWriteObject(); }