All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mchange.conveniences.throwable.core.scala Maven / Gradle / Ivy

The newest version!
package com.mchange.conveniences.throwable

import scala.util.control.NonFatal

def extractFullStackTrace(t:Throwable) : String =
  val sw = new java.io.StringWriter()
  t.printStackTrace(new java.io.PrintWriter(sw))
  sw.toString()

extension (t : Throwable)
  def fullStackTrace : String = extractFullStackTrace(t)

object NonFatals:
  val PrintStackTrace : PartialFunction[Throwable,Unit] = {
    case NonFatal(t : Throwable) => t.printStackTrace()
  }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy