com.gemstone.gbj

## Class GbjException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.lang.RuntimeException
      - - com.gemstone.gbj.GbjException

- All Implemented Interfaces:
    java.io.Serializable
  Direct Known Subclasses:
    GbjAbortingException, GbjCompilerException, GbjEventException, GbjFatalException, GbjInternalException, GbjNonKernelException, GbjRuntimeException

      public class GbjException
      extends java.lang.RuntimeException

  This class represents a GemStone server exception. The members of a GbjException are very similar to those in a GciErrSType structure in the "GemBuilder for C" product.
  Version:
    3.0
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `int` | `argCount` The size of args[]
    `java.lang.Object[]` | `args` An array of references to the arguments of the exception
    `GbjObject` | `category` Holds a reference to the category (signalDictionary) of the exception.
    `boolean` | `fatal` Tells you whether the exception was a fatal error.
    `static GbjGemStoneErrors` | `kernel` Holds an extensive list of error numbers for GbjExceptions of category GemStoneError.
    `java.lang.String` | `message` Holds a displayable representation of the exception
    `int` | `number` Holds the number of the exception.
    `GbjObject` | `process` The suspended state of execution on the server at the time the exception was thrown.
    `GbjSession` | `session` The session in which the exception occurred.
    `java.lang.String` | `stackReport` Smalltalk stack or null, requires System gemConfigurationAt:#GemExceptionSignalCapturesStack put: true to have been executed, such as via UserProfile >> loginHook:
    `GbjObject` | `stackTrace` Deprecated. use stackReport

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GbjException()` Construct an instance that will be filled in by another
    `GbjException(GbjGciException e)` Construct an instance from information coming from the GbjGciInterface
    `GbjException(GbjSession s, GbjGciException e)`
    `GbjException(GbjSession s, java.lang.String msg)`
    `GbjException(java.lang.String msg)` Construct an instance with specified message.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getMessage()` return the error message held by the receiver.
    `boolean` | `isAbortingException()` is this an Aborting exception - an exception associated with a rolled back transaction in the server?
    `boolean` | `isCompilerException()` is this a Smalltalk compilation exception?
    `boolean` | `isEventException()` is this an Event exception - a signal or debugging event?
    `boolean` | `isFatalException()` is this a Fatal exception - one that terminated the connection or otherwise rendered it unusable?
    `boolean` | `isInternalException()` is this an Internal exception - one that signals an internal problem in the GemStone server or interface?
    `boolean` | `isRuntimeException()` is this a Smalltalk execution exception?
    `void` | `printStackTrace()`
    `void` | `printStackTrace(java.io.PrintStream s)`
    `void` | `printStackTrace(java.io.PrintWriter s)`
    `void` | `saveProcess()` causes the exception's Smalltalk process to be saved in the server's export set even if this exception object is reclaimed as garbage.
    `void` | `setMessage(java.lang.String aString)` Set the GemStone exception message text.

    - ### Methods inherited from class java.lang.Throwable

      `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, setStackTrace, toString`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### kernel

          public static final GbjGemStoneErrors kernel

      Holds an extensive list of error numbers for GbjExceptions of category GemStoneError.
      See Also:
        `GbjSession.kernel`, `GbjKernelObjects`, `GbjGemStoneErrors`

    - #### message

          public java.lang.String message

      Holds a displayable representation of the exception

    - #### category

          public GbjObject category

      Holds a reference to the category (signalDictionary) of the exception. This can be compared with the GbjSession GemStoneError member to see if the exception was thrown by GemStone or was a user-defined error.

    - #### number

          public int number

      Holds the number of the exception. A full list of the errors that GemStone may throw can be found in the file gcierr.ht in the GemStone installation directory's "include" subdirectory.

    - #### args

          public java.lang.Object[] args

      An array of references to the arguments of the exception

    - #### argCount

          public int argCount

      The size of args[]

    - #### fatal

          public boolean fatal

      Tells you whether the exception was a fatal error. If it was a fatal error, the session should be closed.

    - #### process

          public GbjObject process

      The suspended state of execution on the server at the time the exception was thrown. An exception's process object is released on finalization of the exception unless the process variable is nulled or the saveProcess message is sent to the exception.
      See Also:
        `saveProcess()`

    - #### session

          public GbjSession session

      The session in which the exception occurred.

    - #### stackTrace

          @Deprecated
          public GbjObject stackTrace

      Deprecated. use stackReport
      If stack traces have been turned on, this will hold a trace of GemStone execution at the time of the exception.

    - #### stackReport

          public java.lang.String stackReport

      Smalltalk stack or null, requires System gemConfigurationAt:#GemExceptionSignalCapturesStack put: true to have been executed, such as via UserProfile >> loginHook:

  - ### Constructor Detail

    - #### GbjException

          public GbjException()

      Construct an instance that will be filled in by another

    - #### GbjException

          public GbjException(java.lang.String msg)

      Construct an instance with specified message.
      Parameters:
        `msg` - String containing message

    - #### GbjException

          public GbjException(GbjSession s,
                              java.lang.String msg)

    - #### GbjException

          public GbjException(GbjGciException e)

      Construct an instance from information coming from the GbjGciInterface
      Parameters:
        `e` - GbjGciException

    - #### GbjException

          public GbjException(GbjSession s,
                              GbjGciException e)

  - ### Method Detail

    - #### getMessage

          public java.lang.String getMessage()

      return the error message held by the receiver. Except for local internal errors, this message will be localized based on the account configuration in GemStone.
      Overrides:
        `getMessage` in class `java.lang.Throwable`

    - #### isCompilerException

          public boolean isCompilerException()

      is this a Smalltalk compilation exception?
      Returns:
        boolean

    - #### isRuntimeException

          public boolean isRuntimeException()

      is this a Smalltalk execution exception?
      Returns:
        boolean

    - #### isAbortingException

          public boolean isAbortingException()

      is this an Aborting exception - an exception associated with a rolled back transaction in the server?
      Returns:
        boolean

    - #### isFatalException

          public boolean isFatalException()

      is this a Fatal exception - one that terminated the connection or otherwise rendered it unusable?
      Returns:
        boolean

    - #### isInternalException

          public boolean isInternalException()

      is this an Internal exception - one that signals an internal problem in the GemStone server or interface?
      Returns:
        boolean

    - #### isEventException

          public boolean isEventException()

      is this an Event exception - a signal or debugging event?
      Returns:
        boolean

    - #### setMessage

          public void setMessage(java.lang.String aString)

      Set the GemStone exception message text.
      Parameters:
        `aString` - Message text

    - #### saveProcess

          public void saveProcess()

      causes the exception's Smalltalk process to be saved in the server's export set even if this exception object is reclaimed as garbage. This is useful if the process will be held for debugging or rescheduling. This method does not protect the method from being removed from the server's export set by other means.

    - #### printStackTrace

          public void printStackTrace()

      Overrides:
        `printStackTrace` in class `java.lang.Throwable`

    - #### printStackTrace

          public void printStackTrace(java.io.PrintStream s)

      Overrides:
        `printStackTrace` in class `java.lang.Throwable`

    - #### printStackTrace

          public void printStackTrace(java.io.PrintWriter s)

      Overrides:
        `printStackTrace` in class `java.lang.Throwable`