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.
@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;
}
}
@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;
}
}