customError() vs. throwCustomError()
This is an open discussion with 7 replies, filed under Extensions.
Search
is there a good way to search the API pages?
I'm using the Find functionality in my editor :) coupled with smart code interpretation it does the job.
The throwCustomError
function is new in Symphony 2.3.2, so it's documentation doesn't exist yet as it is usually generated when it reaches Release Candidate status.
Like @vladG said, all the code is documented at the source level, so here is the relevant documentation for throwCustomError
. The method will replace customError()
as it includes better support for correctly setting response headers.
vladG, I use find in my editor as well, but it only seems to work in a single file. I guess you have a project set up with all of the source code from Symphony and any extensions you work on, and your editor will search all of the files? What editor do you use? I'm working with pretty basic stuff, geany and Ubuntu.
brendo, I don't know how I missed that. I was sure I searched that file. Anyway, it looks like customError() will still be available, but if an extension uses throwCustomError() it won't be compatible with pre-2.3.2 versions?
I guess you have a project set up with all of the source code from Symphony and any extensions you work on, and your editor will search all of the files?
Yes.
What editor do you use?
PhpStorm. Brilliant.
PhpStorm. Brilliant.
Changed my life.
brendo, I don't know how I missed that. I was sure I searched that file. Anyway, it looks like customError() will still be available, but if an extension uses throwCustomError() it won't be compatible with pre-2.3.2 versions?
Correct :)
Create an account or sign in to comment.
I came across this line in on Github. It uses:
I can't find that documented in the API pages at getsymphony.com, and I can't get throwCustomError() to work in my extension. However, I found customError() in the API pages. Which one of these is "right" for a current stable version of Symphony?
Also, is there a good way to search the API pages? I usually end up with putting "site:getsymphony.com codeidontunderstand" into Google, but that didn't pull up this particular method.