Exception thrown from core should with error code

Not only message but also the code, to facilitate further determination.

I think using proper exceptions instead of old fashioned error handling is on the todo list for Yii 2.0.

At least I hope it is. :)

jacmoe, I’m thinking about creating more accounts to cast more votes on your post :)

Throwing exceptions is so much better than arbitrary return values or error states.

I mean :

throw new Exception($message, $code);

The code is the $code in Exception.

I’d prefer an exception hirachy like

InvalidUrlException(Invalid Url detected)->RequestException->HTTPException->Exception

in addition to the use of a exception code to handle these programaticly (hard to do this with messages)