logo

const class

sys::Err

sys::Obj
  sys::Err
  1  //
  2  // Copyright (c) 2006, Brian Frank and Andy Frank
  3  // Licensed under the Academic Free License version 3.0
  4  //
  5  // History:
  6  //   11 Jan 06  Brian Frank  Creation
  7  //
  8  
  9  **
 10  ** Err is the base class of all exceptions.
 11  **
 12  const class Err
 13  {
 14  
 15  //////////////////////////////////////////////////////////////////////////
 16  // Constructor
 17  //////////////////////////////////////////////////////////////////////////
 18  
 19    **
 20    ** Construct with specified error message and optional root cause.
 21    **
 22    new make(Str msg := null, Err cause := null)
 23  
 24  //////////////////////////////////////////////////////////////////////////
 25  // Methods
 26  //////////////////////////////////////////////////////////////////////////
 27  
 28    **
 29    ** Get the string message passed to the contructor or null if
 30    ** a message is not available.
 31    **
 32    Str message()
 33  
 34    **
 35    ** Get the underyling cause exception or null.
 36    **
 37    Err cause()
 38  
 39    **
 40    ** Dump the stack trace of this exception to the specified
 41    ** output stream (or Sys.out by default).
 42    **
 43    Void trace(OutStream out := Sys.out)
 44  
 45    **
 46    ** Return the qualified type name and optional message.
 47    **
 48    override Str toStr()
 49  
 50  }