java.lang.Error.printStackTrace()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(4.6k)|赞(0)|评价(0)|浏览(145)

本文整理了Java中java.lang.Error.printStackTrace()方法的一些代码示例,展示了Error.printStackTrace()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Error.printStackTrace()方法的具体详情如下:
包路径:java.lang.Error
类名称:Error
方法名:printStackTrace

Error.printStackTrace介绍

暂无

代码示例

代码示例来源:origin: commons-lang/commons-lang

/**
   * {@inheritDoc}
   */
  public final void printPartialStackTrace(PrintWriter out) {
    super.printStackTrace(out);
  }
}

代码示例来源:origin: jenkinsci/jenkins

throw e;
} catch (Error e) {
  e.printStackTrace();
  throw e;

代码示例来源:origin: alibaba/Sentinel

} catch (Error error) {
  RecordLog.warn("[InitExecutor] Init failed with fatal error", error);
  error.printStackTrace();
  throw error;

代码示例来源:origin: pentaho/pentaho-kettle

void refreshObject() {
 int index = list.getSelectionIndex();
 if ( index == -1 ) {
  return;
 }
 if ( check.getSelection() ) {
  ByteArrayOutputStream stream = new ByteArrayOutputStream();
  PrintStream s = new PrintStream( stream );
  errors[index].printStackTrace( s );
  text.setText( stream.toString() );
  text.setVisible( true );
  canvas.setVisible( false );
 } else {
  canvas.setVisible( true );
  text.setVisible( false );
  canvas.redraw();
 }
}

代码示例来源:origin: Bilibili/DanmakuFlameMaster

nativeLibLoaded = false;
} catch (Error e) {
  e.printStackTrace();
  notLoadAgain = true;
  nativeLibLoaded = false;

代码示例来源:origin: internetarchive/heritrix3

System.err.println(err);
System.err.println(extraInfo);
err.printStackTrace(System.err);

代码示例来源:origin: org.apache.logging.log4j/log4j-core

@Test
  public void testDataSourceConfig() throws Exception {
    try (final Connection connection = jdbcRule.getConnectionSource().getConnection()) {
      final Error exception = new Error("Final error massage is fatal!");
      final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
      final PrintWriter writer = new PrintWriter(outputStream);
      exception.printStackTrace(writer);
      writer.close();

      final Logger logger = LogManager.getLogger(this.getClass().getName() + ".testDataSourceConfig");
      MapMessage mapMessage = new MapMessage();
      mapMessage.with("Id", 1);
      mapMessage.with("ColumnA", "ValueA");
      mapMessage.with("ColumnB", "ValueB");
      logger.info(mapMessage);

      try (final Statement statement = connection.createStatement();
          final ResultSet resultSet = statement
              .executeQuery("SELECT Id, ColumnA, ColumnB FROM dsLogEntry ORDER BY Id")) {

        assertTrue("There should be at least one row.", resultSet.next());

        Assert.assertEquals(1, resultSet.getInt("Id"));

        assertFalse("There should not be two rows.", resultSet.next());
      }
    }
  }
}

代码示例来源:origin: apache/geode

t.printStackTrace();
 throw t;
} catch (RuntimeException re) {

代码示例来源:origin: org.apache.logging.log4j/log4j-core

final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
try (final PrintWriter writer = new PrintWriter(outputStream)) {
  exception.printStackTrace(writer);

代码示例来源:origin: apache/flink

e.printStackTrace();
printProcessLog("TaskManager 1", processOutput1.toString());
printProcessLog("TaskManager 2", processOutput2.toString());

代码示例来源:origin: xalan/xalan

if (_debug) e.printStackTrace();
_parser.reportError(Constants.FATAL, new ErrorMsg(e));

代码示例来源:origin: magefree/mage

e.printStackTrace();
} catch (Error err) {
  err.printStackTrace();

代码示例来源:origin: blazegraph/database

public void printStackTrace(java.io.PrintStream s) {
  if (m_cause != null) {
    m_cause.printStackTrace(s);
  } else {
    super.printStackTrace(s);
  }
}

代码示例来源:origin: com.blazegraph/bigdata-core

public void printStackTrace(java.io.PrintStream s) {
  if (m_cause != null) {
    m_cause.printStackTrace(s);
  } else {
    super.printStackTrace(s);
  }
}

代码示例来源:origin: c3p0/c3p0

public void printStackTrace(PrintWriter pw)
{
super.printStackTrace(pw);
if (nested != null)
  {
  pw.println(NESTED_MSG);
  nested.printStackTrace(pw);
  }
}

代码示例来源:origin: c3p0/c3p0

public void printStackTrace(PrintStream ps)
{
super.printStackTrace(ps);
if (nested != null)
  {
  ps.println("NESTED_MSG");
  nested.printStackTrace(ps);
  }
}

代码示例来源:origin: com.mchange/mchange-commons-java

public void printStackTrace(PrintStream ps)
{
super.printStackTrace(ps);
if (nested != null)
  {
  ps.println("NESTED_MSG");
  nested.printStackTrace(ps);
  }
}

代码示例来源:origin: com.sun.xml.bind/jaxb1-impl

public void printStackTrace( java.io.PrintStream s ) {
  if( linkedException != null ) {
   linkedException.printStackTrace(s);
   s.println("--------------- linked to ------------------");
  }
  super.printStackTrace(s);
}

代码示例来源:origin: magefree/mage

e.printStackTrace();
} catch (Error err) {
  err.printStackTrace();

代码示例来源:origin: org.jboss/jboss-common-core

/**
* Prints the composite message and the embedded stack trace to the
* specified print writer.
*
* @param writer  Writer to print to.
*/
public void printStackTrace(final PrintWriter writer) {
 if (nested == null || NestedThrowable.PARENT_TRACE_ENABLED) {
   super.printStackTrace(writer);
 }
 NestedThrowable.Util.print(nested, writer);
}

相关文章