Renders a throwable including stack trace and cause throwables.

@param throwable
Throwable to render
@param builder
Output will be appended to this string builder
484831
private static void render(final Throwable throwable, final StringBuilder builder) {
		builder.append(throwable.getClass().getName());
		String message = throwable.getMessage();
		if (message != null) {
			builder.append(": ");
			builder.append(message);
		}

		StackTraceElement[] stackTrace = throwable.getStackTrace();
		for (int i = 0; i < stackTrace.length; ++i) {
			builder.append(NEW_LINE);
			builder.append("\tat ");
			builder.append(stackTrace[i]);
		}

		Throwable cause = throwable.getCause();
		if (cause != null) {
			builder.append(NEW_LINE);
			builder.append("Caused by: ");
			render(cause, builder);
		}
	}
263872
public static <T extends Throwable> T clearStackTrace(@NotNull T throwable) {
		Throwable cause = throwable;
		while (cause != null) {
			cause.setStackTrace(EMPTY_STACK_TRACE);
			cause = cause.getCause();
		}
		return throwable;
	}
1090948
@Override
	public void onUncaughtException(Throwable throwable) {
		for (ErrorHandler handler : this.errorHandlers) {
			if (handler.handle(throwable)) {
				return;
			}
		}
		this.defaultHandler.handle(throwable);
	}
1340583
public static RuntimeException propagate(Throwable throwable) {
    final Throwable t = Preconditions.checkNotNull(throwable, "throwable");
    if (t instanceof Error) {
      throw (Error) t;
    }
    if (t instanceof RuntimeException) {
      throw (RuntimeException) t;
    }

    throw new RuntimeException(t);
  }
206834
final public ThrowExpressionBuilder<T> throwExp() {
    final int sourceLineNumber = builder.getSourceLineNumber();
    return new ThrowExpressionBuilder<T>(new ExpressionHandler<T>() {
      public T handleExpression(Expression e) {
        return statementHandler().handleStatement(new ThrowStatement(sourceLineNumber, e));
      }
    });
  }
1020709
public function handle(ExceptionBuilder $builder)
    {

        $exceptionName = $this->argument('ExceptionName');

        $view = $this->argument('View');

        $masterPageName = $this->argument('MasterPageName');

        $builder->setFileNamesAndPaths($exceptionName, $view, $masterPageName);


        if ( $builder->makeExceptionFiles() ) {

            $this->sendSuccessMessage();

            return;

        }

        $this->error('Oops, something went wrong!');


    }
278319
public static <T> ResultQueueEntry<T> fromThrowable(Throwable throwable) {
    Preconditions.checkArgument(throwable != null, "Throwable may not be null");
    return new ExceptionResultQueueEntry<T>(throwable);
  }
940612
@Override
    public void throwing(String sourceClass, String sourceMethod, Throwable thrown) {
        if (isLoggable(Level.FINER)) {
            LogRecord logRecord = createLogRecord(Level.FINER, "THROW", null, sourceClass, sourceMethod, null, thrown);
            log(logRecord);
        }
    }
134641
@Override
  public void logException(LogLevel logLevel, Throwable throwable, Class clazz, String methodName) {
    Logger logger = Logger.getLogger(clazz.getName());
    logger.logp(convertToJDK14Level(logLevel), clazz.getName(), "-", throwable.getMessage(), throwable);
  }
11679
protected void dispatch(Throwable object, boolean child) {
        if (object instanceof CompilationFailedException) {
            report((CompilationFailedException) object, child);
        } else if (object instanceof GroovyExceptionInterface) {
            report((GroovyExceptionInterface) object, child);
        } else if (object instanceof GroovyRuntimeException) {
            report((GroovyRuntimeException) object, child);
        } else if (object instanceof Exception) {
            report((Exception) object, child);
        } else {
            report(object, child);
        }

    }
176161
public RedGBuilder<T> withSqlValuesFormatter(final SQLValuesFormatter formatter) {
        if (instance == null) {
            throw new IllegalStateException("Using the builder after build() was called is not allowed!");
        }
        instance.setSqlValuesFormatter(formatter);
        return this;
    }
1348763
public static FormattedStringBuilder wrap(StringBuilder builder) {
        FormattedStringBuilder b = new FormattedStringBuilder();
        b._delegate = builder;
        return b;
    }
1307573
@Override
    @CallerSideMethod public void onError(Throwable throwable) {
        if ( throwable == null )
            throw null;
        _onError(throwable);
    }
794018
@Nonnull
	public final LBiObjDblConsumerBuilder<T1, T2> withHandling(@Nonnull HandlingInstructions<RuntimeException, RuntimeException> handling) {
		Null.nonNullArg(handling, "handling");
		if (this.handling != null) {
			throw new UnsupportedOperationException("Handling is already set for this builder.");
		}
		this.handling = handling;
		return self();
	}
363513
@Override
    public void debug(String message, Throwable throwable) {
        if(this.logger.isDebugEnabled()) {
            this.logger.debug(buildMessage(message), throwable);
        }
    }
855326
private void throwUnrecognizedInputIfAny( StringBuilder builder, int ch ) {
        if( !isWhitespace( builder ) ) {
            throw createException( "Unrecognized input: '" + trim( builder ) + (char)ch + "'" );
        }
        builder.setLength( 0 );
    }
446408
public static String render(final Object object) {
        try {
            final StringBuilder builder = new StringBuilder();
            render(object, builder);
            return builder.toString();
        } catch (final IOException ex) {
            throw new Error(ex); // should not happen
        }
    }