public static String getErrorInfoFromException(Throwable throwable) {
        try (StringWriter stringWriter = new StringWriter(); PrintWriter printWriter = new PrintWriter(stringWriter)) {
            throwable.printStackTrace(printWriter);
            return stringWriter.toString();
        } catch (Exception e) {
            log.error("ErrorInfoFromException", e);
            return "ErrorInfoFromException";
        }
    }
print stack trace

@param throwable
@return
chat2db-server/chat2db-spi/src/main/java/ai/chat2db/spi/util/ExceptionUtils.java