Skip to content

Instantly share code, notes, and snippets.

@RobinRadic
Created February 1, 2016 08:56
Show Gist options
  • Save RobinRadic/d423a38d22f5b88d49ee to your computer and use it in GitHub Desktop.
Save RobinRadic/d423a38d22f5b88d49ee to your computer and use it in GitHub Desktop.
<?php
class ProjectNotFoundException extends \Exception
{
public static function missingConfig()
{
return new static("Could not find the project config file");
}
public static function missingDatabase()
{
return new static("Could not find the project in the database");
}
public function in($path)
{
$this->message .= " in [{$path}]";
return $this;
}
}
@RobinRadic
Copy link
Author

function index(){
    throw ProjectNotFoundException::missingDatabase()->in(__DIR__);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment