Not only message but also the code, to facilitate further determination.
Page 1 of 1
Exception thrown from core should with error code
#2
Posted 10 June 2012 - 09:49 PM
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.
At least I hope it is.
"Less noise - more signal"
#3
Posted 10 June 2012 - 10:20 PM
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.
Throwing exceptions is so much better than arbitrary return values or error states.
Rodrigo Coelho
Check my extension
giix: a code generator for Yii.
The complete beginner's study guide for the Yii Framework
Check my extension
giix: a code generator for Yii.

The complete beginner's study guide for the Yii Framework
#4
Posted 11 June 2012 - 12:05 AM
I mean :
throw new Exception($message, $code);
The code is the $code in Exception.
throw new Exception($message, $code);
The code is the $code in Exception.
#5
Posted 11 June 2012 - 07:45 AM
kernel, on 11 June 2012 - 12:05 AM, said:
I mean :
throw new Exception($message, $code);
The code is the $code in Exception.
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)
Share this topic:
Page 1 of 1

Help

This topic is locked











