@Tobion ``getCode`` is final so it cannot be mocked.

FYI, a case were exceptions are using string codes is PDOException