I have such method:
public function someMethod($param1 = null, $param2 = null)
{
...
if ($param1 == null &&...)
{
throw new Exception("Some parameter is wrong", 601);
}
}
Is it a good practice to include dynamic data in the Exception msg, since I have the exception code ? For example the exception could look like this:
throw new Exception("First parameter is wrong. You passed: {$param1}", 601);
What is your opinion, is it okey messages to be dynamic or I should stick to fixed text for the Exception messages ?