异常是否应包含动态数据?

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 ?

Should exceptions contain dynamic data?

Should? No. but they can! but be sure that "generating" this dynamic data will not cause another exception.

But you should never throw new Exception(). Extend it for your own custom exceptions or use javas exceptions like IllegalArgumentException