edu.ucsb.nceas.metacat

## Class McdbException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - edu.ucsb.nceas.metacat.McdbException

- All Implemented Interfaces:
    java.io.Serializable
  Direct Known Subclasses:
    McdbDocNotFoundException

      public class McdbException
      extends java.lang.Exception

  Exception thrown when an error occurs because a problem occurred in the metacat database. This is the general type of Exception that is thrown whenever the server encounters an Error or Exception that is outside of the scope of normal operation. This class may be subclassed to provide more detailed informatin about the error.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `McdbException()` Create a new McdbException.
    `McdbException(java.lang.Exception e)` Create a new McdbException.
    `McdbException(java.lang.String message)` Create a new McdbException.
    `McdbException(java.lang.String message, java.lang.Exception e)` Create a new McdbException.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Exception` | `getException()` Get the tunneled Exception
    `java.lang.String` | `getMessage()` Get the message from this exception.
    `void` | `toXml(java.io.Writer pw)` Print the message from this exception in XML format.

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

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

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

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

- - ### Constructor Detail

    - #### McdbException

          public McdbException()

      Create a new McdbException.

    - #### McdbException

          public McdbException(java.lang.String message)

      Create a new McdbException.
      Parameters:
        `message` - The error or warning message.

    - #### McdbException

          public McdbException(java.lang.Exception e)

      Create a new McdbException.
      Parameters:
        `e` - The exception to tunnel inside this exception

    - #### McdbException

          public McdbException(java.lang.String message,
                               java.lang.Exception e)

      Create a new McdbException.
      Parameters:
        `message` - The error or warning message.
        `e` - The exception to tunnel inside this exception

  - ### Method Detail

    - #### getException

          public java.lang.Exception getException()

      Get the tunneled Exception

    - #### getMessage

          public java.lang.String getMessage()

      Get the message from this exception.

      This returns the message from this exception, but if it is null, and if the tunnelled exception is not null, then it returns the message fromthe tunnelled exception.

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

    - #### toXml

          public void toXml(java.io.Writer pw)

      Print the message from this exception in XML format.

      This returns the message from this exception, but if it is null, and if the tunnelled exception is not null, then it returns the message from the tunnelled exception.

Copyright © 2020 Regents of the University of California. All Rights Reserved.