<?php
class userException extends ErrorException {
  /* プロパティ */
  protected $errorCode;
  protected $errorMessage;
  protected $errorData;

  public function __construct($errorCode, $errorMessage, $data, $file=__FILE__, $line=__LINE__) {
    $logger = new logger(basename(__FILE__));
    $this->errorCode = $errorCode;
    $this->errorMessage = $errorMessage;
    $this->errorData = $data;

    $logger->error($errorCode, $errorMessage);
    $logger->error($file . "(" . $line . ")", "=======================================================");
    $logger->error("data", $data);
    $logger->error("=================================");

    parent::__construct($errorMessage,0,E_ERROR,$file,$line);
  }

  public function getErrorCode() {
    return $this->errorCode;
  }
  public function getErrorMessage() {
    return $this->errorMessage;
  }

  /*おそらくoracleのsqlcode*/
  public function getErrorOraCode() {
    return $this->errorData->errorInfo[1];
  }
  /*おそらくoracleのエラーメッセージ*/
  public function getErrorOraMessage() {
    return $this->errorData->message;
  }

}
?>
