Skip to main content
Code Review

Return to Question

replaced http://codereview.stackexchange.com/ with https://codereview.stackexchange.com/
Source Link

Moving on to the next steps! Previous review was here here. The idea here was to implement suggestions made by @hd/@Pimgd and then implement an effective way of tracking and logging results when an exception is thrown. With that said, my focus is still on security of my application, but now I also really want feedback on the data being sent when an error is triggered, and it's effectiveness or usefulness.

Moving on to the next steps! Previous review was here. The idea here was to implement suggestions made by @hd/@Pimgd and then implement an effective way of tracking and logging results when an exception is thrown. With that said, my focus is still on security of my application, but now I also really want feedback on the data being sent when an error is triggered, and it's effectiveness or usefulness.

Moving on to the next steps! Previous review was here. The idea here was to implement suggestions made by @hd/@Pimgd and then implement an effective way of tracking and logging results when an exception is thrown. With that said, my focus is still on security of my application, but now I also really want feedback on the data being sent when an error is triggered, and it's effectiveness or usefulness.

Rollback to Revision 2
Source Link
Mast
  • 13.8k
  • 12
  • 57
  • 127

@Mike Brant had an answer below where he was asking to see the Custom Exceptions. They really don't do anything major. All I created them for was the naming convention for more readability and easier managing of responses in the controller. Below is PDOQueryException and PDOConnectException is the exact same minus $sql.

PDOQueryException

class PDOQueryException extends Exception
{
private $sql;
public function __construct($message, $sql, $code = 0, Exception $previous = null) {
 $this->sql = $sql;
 parent::__construct($message,$code,$previous);
}
public function __toString() {
 return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
}
public function getQuery() {
 return $this->sql;
}
}

@Mike Brant had an answer below where he was asking to see the Custom Exceptions. They really don't do anything major. All I created them for was the naming convention for more readability and easier managing of responses in the controller. Below is PDOQueryException and PDOConnectException is the exact same minus $sql.

PDOQueryException

class PDOQueryException extends Exception
{
private $sql;
public function __construct($message, $sql, $code = 0, Exception $previous = null) {
 $this->sql = $sql;
 parent::__construct($message,$code,$previous);
}
public function __toString() {
 return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
}
public function getQuery() {
 return $this->sql;
}
}
added 800 characters in body
Source Link
Trojan404
  • 838
  • 6
  • 25

@Mike Brant had an answer below where he was asking to see the Custom Exceptions. They really don't do anything major. All I created them for was the naming convention for more readability and easier managing of responses in the controller. Below is PDOQueryException and PDOConnectException is the exact same minus $sql.

PDOQueryException

class PDOQueryException extends Exception
{
private $sql;
public function __construct($message, $sql, $code = 0, Exception $previous = null) {
 $this->sql = $sql;
 parent::__construct($message,$code,$previous);
}
public function __toString() {
 return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
}
public function getQuery() {
 return $this->sql;
}
}

@Mike Brant had an answer below where he was asking to see the Custom Exceptions. They really don't do anything major. All I created them for was the naming convention for more readability and easier managing of responses in the controller. Below is PDOQueryException and PDOConnectException is the exact same minus $sql.

PDOQueryException

class PDOQueryException extends Exception
{
private $sql;
public function __construct($message, $sql, $code = 0, Exception $previous = null) {
 $this->sql = $sql;
 parent::__construct($message,$code,$previous);
}
public function __toString() {
 return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
}
public function getQuery() {
 return $this->sql;
}
}
added 7 characters in body
Source Link
Trojan404
  • 838
  • 6
  • 25
Loading
Source Link
Trojan404
  • 838
  • 6
  • 25
Loading
lang-php

AltStyle によって変換されたページ (->オリジナル) /