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

org.postgresql.util.PSQLException Maven / Gradle / Ivy

There is a newer version: 5.0.0.9.pg
Show newest version
/*
 * Copyright (c) 2003, PostgreSQL Global Development Group
 * See the LICENSE file in the project root for more information.
 */


package io.mogdb.util;

import java.sql.SQLException;

public class PSQLException extends SQLException {

  private ServerErrorMessage _serverError;

  public PSQLException(String msg, PSQLState state, Throwable cause) {
    super(msg, state == null ? null : state.getState(), cause);
  }
  
  public PSQLException(String msg,PSQLState state,int errorcode,Throwable cause)
  {
      super(msg, state == null ? null : state.getState(),errorcode);
      initCause(cause);
  }
  
  public PSQLException(String msg, PSQLState state) {
    super(msg, state == null ? null : state.getState());
  }
  
  public PSQLException(String msg, PSQLState state,int errorcode)
  {
      this(msg, state,errorcode, null);
  }

  public PSQLException(ServerErrorMessage serverError) {
    super(serverError.toString(), serverError.getSQLState(),
        (serverError.getERRORCODE() == null) ? 0 : Integer.parseInt(serverError.getERRORCODE()));
    _serverError = serverError;
  }

  public ServerErrorMessage getServerErrorMessage() {
    return _serverError;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy