Do not convert incorrect code types to integer automatically.
If $code is null it will be converted to 0 by the default Exception
anyhow.
If $code contains a string it will elicit a Fatal Error. But that is
okay and should not be hidden. In nearly all cases where we provided a
string as $code it was a simple coding error that needs to be fixed.
There may be cases where the code is a value returned from another
library. If it is uncertain that the library ensures that the return
value is an integer then it can be cast into an integer before
providing it to the exception.