Pass path and error code to exceptions

This commit is contained in:
Robin Appelman 2014-10-17 14:55:53 +02:00
commit 77c30c698f
4 changed files with 80 additions and 50 deletions

View file

@ -7,4 +7,25 @@
namespace Icewind\SMB\Exception;
class InvalidRequestException extends Exception {}
class InvalidRequestException extends Exception {
/**
* @var string
*/
protected $path;
/**
* @param string $path
* @param int $code
*/
public function __construct($path, $code = 0) {
parent::__construct('Invalid request for ' . $path, $code);
$this->path = $path;
}
/**
* @return string
*/
public function getPath() {
return $this->path;
}
}