Error

io.joern.console.Error
class Error(message: String) extends RuntimeException, NoStackTrace

If you need to throw an Exception that renders ok-ish to the user. e.g. cpg.help when no cpg is loaded:

joern> cpg.help
io.joern.console.Error: No CPG loaded for project c - try e.g. `help|importCode|importCpg|open`

In comparison, with a regular Exception the user sees

joern> cpg.help
java.lang.RuntimeException: No CPG loaded for project console1665115232529348622
- try e.g. `help|importCode|importCpg|open`
 at io.joern.console.workspacehandling.WorkspaceManager.cpg(WorkspaceManager.scala:218)
 at io.joern.console.Console.cpg(Console.scala:137)
 ... 39 elided

Attributes

Graph
Supertypes
trait NoStackTrace
class RuntimeException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

final def addSuppressed(x$0: Throwable): Unit

Attributes

Inherited from:
Throwable
override def fillInStackTrace(): Throwable

Attributes

Definition Classes
NoStackTrace -> Throwable
Inherited from:
NoStackTrace
def getCause(): Throwable

Attributes

Inherited from:
Throwable
def getLocalizedMessage(): String

Attributes

Inherited from:
Throwable
def getMessage(): String

Attributes

Inherited from:
Throwable
def getStackTrace(): Array[StackTraceElement]

Attributes

Inherited from:
Throwable
final def getSuppressed(): Array[Throwable]

Attributes

Inherited from:
Throwable
def initCause(x$0: Throwable): Throwable

Attributes

Inherited from:
Throwable
def printStackTrace(x$0: PrintWriter): Unit

Attributes

Inherited from:
Throwable
def printStackTrace(x$0: PrintStream): Unit

Attributes

Inherited from:
Throwable
def printStackTrace(): Unit

Attributes

Inherited from:
Throwable

Attributes

Inherited from:
NoStackTrace
def setStackTrace(x$0: Array[StackTraceElement]): Unit

Attributes

Inherited from:
Throwable
def toString(): String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Inherited from:
Throwable