package com.avg.zaap.crashlibrary.core;

/**
 * This class serves as the default crash uncaught exception handler helper.
 * <p/>
 * Created by marek.osvald on 30.5.2016.
 */
public class CrashUncaughtExceptionHandlerHelper implements ICrashUncaughtExceptionHandlerHelper {

    @Override
    public String getErrorDetails(Throwable throwable) {
        StringBuilder stringBuilder = new StringBuilder();

        for (StackTraceElement stackTraceElement : throwable.getStackTrace()) {
            stringBuilder.append(stackTraceElement.toString());
            stringBuilder.append('\n');
        }

        return stringBuilder.toString();
    }

}
