Using Cakephp 2.5.4 on a fresh cake code base.
I have my AppController Setup as follows.
class AppController extends Controller {
public function beforeRender() {
// Filter all output
array_walk_recursive($this-viewVars, [$this, 'escapeOutput']);
// throw new
I am purposefully throwing errors to see results of bad / fictitious / url
manipulated requests and I see when a User is logged in and the action is
prefixed the error also gets prefixed.
[MissingActionException] Action ErrorsController::manage_error404() could
not be found.
I do not want
Thanks for the idea, I looked into it a little, but I don't want to
mess too much with the innards of my app as someone else will be
taking it over soon.
What I ended up doing was placing a link next to the empty job number
textbox that opens a new browser tab/window with the job number list
in
Just an idea...
Extend Mysql datasource:
- override connect():
try {
parent::connect();
} catch (Exception $e) {
return false;
}
- override constructor - set 'autoConnect' flag to false
Model::beforeFind():
$db =
I am reading a list of job numbers from a mysql database on an old
server on my intranet. This server is completely independent from the
server for my cakephp app and database. If the server is there, I
populate a combobox with the list of job numbers, however, if it is
down, I would like to
On Jan/02, Will wrote:
Hi all,
I'm looking for a way to return a generic error every time something
goes wrong with a REST request. So for example, I would like to
return a simple, XML response like:
error
There was a problem processing your request.
/error
Anytime something goes
The Custom Exception Handler should also send out correct headers.
:-)
On 03.01.2012 10:06, Matteo Landi wrote:
On Jan/02, Will wrote:
Hi all,
I'm looking for a way to return a generic error every time something
goes wrong with a REST request. So for example, I would like to
return a
Hi all,
I'm looking for a way to return a generic error every time something
goes wrong with a REST request. So for example, I would like to
return a simple, XML response like:
error
There was a problem processing your request.
/error
Anytime something goes wrong when something is accessed via
Thanks for the advice cricket.
I decided to set up some default settings in bootstrap, achieved this using
array_merge.
function _someFunction($options=array()) {
$defaults=array('someKey' = Configure::read('SomeKey'), ...);
$options = array_merge($defaults, $options);
...
}
I
On Wed, Nov 10, 2010 at 4:42 AM, Stephen step...@ninjacodermonkey.co.uk wrote:
Thanks for the advice cricket.
I decided to set up some default settings in bootstrap, achieved this using
array_merge.
function _someFunction($options=array()) {
$defaults=array('someKey' =
The constant is an email address and may be used in other parts of the
application so I'll keep it in bootstrap, other things would be best as
default values.
On 10 November 2010 17:54, cricket zijn.digi...@gmail.com wrote:
On Wed, Nov 10, 2010 at 4:42 AM, Stephen step...@ninjacodermonkey.co.uk
Hi there,
This is my first time on the mailing list however I'm a big fan of CakePHP.
I'm wondering what is the best way of displaying error messages to the
developer.
I have a private function in my AppController which contains quite a few
required parameters and an options array, I wish to
On Tue, Nov 9, 2010 at 4:14 AM, Stephen step...@ninjacodermonkey.co.uk wrote:
Hi there,
This is my first time on the mailing list however I'm a big fan of CakePHP.
I'm wondering what is the best way of displaying error messages to the
developer.
I have a private function in my
around, I discovered that PHP cannot handle Exceptions
when using Custom Error handling (seehttp://bugs.php.net/bug.php?id=44053).
Using restore_error_handler() doesn't return to the built-in error
handling -- it might be restoring Cake's custom error handler, rather
than the built-in PHP error
exception 'Exception' with message
'something'
After digging around, I discovered that PHP cannot handle Exceptions
when using Custom Error handling (see http://bugs.php.net/bug.php?id=44053).
Using restore_error_handler() doesn't return to the built-in error
handling -- it might be restoring
been searching around, but i couldn't find the right directions for
error handling using cake.
For example, i would like to treat errors from database, like unique keys
violation and sutff like that. Also, any other errors that would happen
would be nice to treat and log
Hello all,
I've been searching around, but i couldn't find the right directions for
error handling using cake.
For example, i would like to treat errors from database, like unique keys
violation and sutff like that. Also, any other errors that would happen
would be nice to treat and log
/class/object
-teh
On May 23, 2:51 pm, Luiz Poleto luiz.pol...@gmail.com wrote:
Hello all,
I've been searching around, but i couldn't find the right directions for
error handling using cake.
For example, i would like to treat errors from database, like unique keys
violation and sutff like
Hi
I would to do a centralized system to manage error in production in my
application.
For the moment I manage cake error with app_error.php
I manage php error inside boostrap.php
I manage database error inside onError in model
I would make a single script from which manage all errors so if I
I think that is a very good solution.
I don't know if another debug level is necessary since you resolve it
in a good way.
On Mar 5, 8:35 am, Aidan Lister aidanlis...@gmail.com wrote:
My previous comment was incorrect, you can easily override
ErrorHandler methods by creating app_error.php and
On Mar 3, 7:28 pm, mscdex msc...@gmail.com wrote:
On Mar 3, 1:08 pm, Aidan Lister aidanlis...@gmail.com wrote:
Does anyone else have any suggestions?
Why not override ErrorHandler's default 'error' function to handle the
HTTP errors?
I think that is a important question: Have a system
Hi,
Firstly, there is no mechanism to overriding any of the functions in
the ErrorHandler class.
Secondly, it's completely unnecessary, as you can use either
_outputMessage() or appError() to achieve the same thing. Neither of
these lend themselves to a) or b).
- Aidan
On Mar 4, 5:28 am,
My previous comment was incorrect, you can easily override
ErrorHandler methods by creating app_error.php and AppError extends
ErrorHandler (as per my first comment).
This is how I have decided to handle production errors now:
?php
/**
* Handle logging errors in production mode
*/
if
, Aidan Lister aidanlis...@gmail.com wrote:
I have two questions for error handling in a production environment.
a) How can I log warnings notices
b) What's the best way to display custom error pages
This is what I know so far,
I can define app_error.php and create my custom error
On Mar 3, 1:08 pm, Aidan Lister aidanlis...@gmail.com wrote:
Does anyone else have any suggestions?
Why not override ErrorHandler's default 'error' function to handle the
HTTP errors?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to
I know this may seem like a strange idea, but why not iron out those
notices before going live?
On Mar 2, 7:52 am, Aidan Lister aidanlis...@gmail.com wrote:
I have two questions for error handling in a production environment.
a) How can I log warnings notices
b) What's the best way
I have two questions for error handling in a production environment.
a) How can I log warnings notices
b) What's the best way to display custom error pages
This is what I know so far,
I can define app_error.php and create my custom error handlers there.
This works fine for development
that exceptions aren't being thrown which I
assume is due to PHP4.x compatibility issues.
Since I can't use try/catch, what's the cake way to catch
exceptions? I see the Error Handling section in the docs, but do I
really need to write a custom error handler just to determine that an
error occurred? I
indicated that exceptions aren't being thrown which I
assume is due to PHP4.x compatibility issues.
Since I can't use try/catch, what's the cake way to catch
exceptions? I see the Error Handling section in the docs, but do I
really need to write a custom error handler just to determine
On Wed, Dec 17, 2008 at 1:48 PM, Rob webwe...@gmail.com wrote:
All you need to do is check that you got something back from the
saveAll, so you wrap it like:
if ($this-User-saveAll($this-data)){
-- success
}
else {
-- failure
}
Then you can look at the error data in the failure
On Wed, Dec 17, 2008 at 2:10 PM, Rob Wilkerson r...@robwilkerson.org wrote:
Would you mind expanding on that just a bit? How would I look at the
error data? In my case, I'd like to echo back an error message. What
structure do I look at to do so?
I may have spoken a little too soon. This
Hi
I would use the Error HAndling of CAKEPHP.
I create a my function in app_error.php
Now if I set the debug to 0 if I use this function I get always
another page (I think the error404 )
If I set debug to 1 I get the right error's page but I get a
performance's worsening.
What can I do ?
Many
maybe this will help:
http://teknoid.wordpress.com/2008/08/29/dealing-with-errors-in-cakephp/
On Oct 29, 1:14 pm, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
Is It someone that can help me?
On 29 Ott, 15:25, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
Hi
I would use the Error HAndling
when debug = 0, AppError::missing*() methods don't get called, instead
you should override ErrorHandler::error404()
[EMAIL PROTECTED] wrote:
Is It someone that can help me?
On 29 Ott, 15:25, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
Hi
I would use the Error HAndling of CAKEPHP.
I
PROTECTED]
[EMAIL PROTECTED] wrote:
Hi
I would use the Error HAndling of CAKEPHP.
I create a my function in app_error.php
Now if I set the debug to 0 if I use this function I get always
another page (I think the error404 )
If I set debug to 1 I get the right error's page but I get
Is It someone that can help me?
On 29 Ott, 15:25, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
Hi
I would use the Error HAndling of CAKEPHP.
I create a my function in app_error.php
Now if I set the debug to 0 if I use this function I get always
another page (I think the error404 )
If I set
to disable Cake's error handling, and just allow the
regular PHP error to be thrown?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe
I think I figured it out.
Adding the following to my Cake loader seems to work.
define('DISABLE_DEFAULT_ERROR_HANDLING', true);
define('CAKEPHP_SHELL', true);
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
you can use Debugger::output('txt')
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL
check out the manual for debugging and logging
http://book.cakephp.org/view/155/Debugging
http://book.cakephp.org/view/157/Logging
also . . .firebug with firephp is a great tool!
On Sep 12, 6:06 pm, Luiz Poleto [EMAIL PROTECTED] wrote:
Hello guys,
I was wondering whether it's possible to
I would make a my error handling.
I use CakePHP 1.13 (I have some old application).
I have create my app_error.php in app/.
But when I use $this-cakeError , it is always referred to the
error.php in cake core.
Do I mistake some to do this or is it not possible in cake 1.13?
thanks
let's see a scene:
i have a Posts controller, and the controller has a view action.
?php
class PostsController extends AppController {
var $name = 'Posts';
var $helpers = array('Html', 'Form');
function view($id = null) {
if (!$id) {
i find using cakeerror can do this.
On Jun 26, 3:43 pm, rain [EMAIL PROTECTED] wrote:
let's see a scene:
i have a Posts controller, and the controller has a view action.
?php
class PostsController extends AppController {
var $name = 'Posts';
var $helpers = array('Html',
In my app/app_controller.php file i have this function:
function authorized()
{
//If the permissions array doesn't exist, everything is accessed
based. [Whitelist]
if(isset($this-actionPermissions))
{
//Same case if
אחי טעית ושלחת לי בטעות (:
2008/2/4, [EMAIL PROTECTED] [EMAIL PROTECTED]:
In my app/app_controller.php file i have this function:
function authorized()
{
//If the permissions array doesn't exist, everything is
accessed
based. [Whitelist]
What I am trying to do is pretty simple, at least in theory. I have a
bunch of product pages, and to add a product to your shopping cart,
you must select a color for the product and a quantity. Then, when you
hit 'add to cart', the form submits the data, and then updates a mini
cart in the
In you ajax submit you can update several div's, so you can have part
updating the side bar (no error) or redraw your form.
you can either have 2 views and you render the one appropriate to
the case, of a single view with a conditional update:
Hope that helps
On Aug 10, 7:36 pm, [EMAIL
Let's say I have a big site application, should I do these kind of
error checking after component/model loading:
loadComponent('AdminSiteTree');
if(!class_exists('AdminSiteTreeComponent'))
$this-cakeError('internalError', null);
What do you say? What do you do in your projects?
On 7/13/07, Ski [EMAIL PROTECTED] wrote:
With cake I get lots of missing controller and other errors that I
don't wish the public to see - they don't care if it's a missing
controller action or whatever, they just need to see a 404 or a
sitemap.
set Debug to 0 and thats what your users
Hi,
I am trying to get to the bottom of error handling in cakephp.
In previous systems I have worked on I have used set_error_handler
to catch php / database errors and email debugging / state information
to the site admin, then redirect to a standard error page.
With cake I get lots
On 5/10/07, Greg Cerveny [EMAIL PROTECTED] wrote:
Definitely helps.
Generally speaking though, do you could an else statement in
regardless if it doesn't need the view or message setting just for
styles sake?
I always put in an else as the saving could fail (and as we all know,
anything
Right on. Thanks for the input. Style is one of the hardest thing to
pickup when coding alone.
2007/5/11, Gonzalo Servat [EMAIL PROTECTED]:
On 5/10/07, Greg Cerveny [EMAIL PROTECTED] wrote:
Definitely helps.
Generally speaking though, do you could an else statement in
regardless if
Definitely helps.
Generally speaking though, do you could an else statement in
regardless if it doesn't need the view or message setting just for
styles sake?
2007/5/10, Gonzalo Servat [EMAIL PROTECTED]:
On 5/10/07, Greg Cerveny [EMAIL PROTECTED] wrote:
Which is better?
if
I've read quite a few posts related to error handling with cake but
still have'nt managed to work out the best way to handle the following
type of error.
There are many cases where a controller method may have been called via
an URL without the correct parameters being passed. (For example
http
Hello,
I was wondering how I could catch an error in Cake?
For example if I do $this-Model-save() in a controller and it fails,
how can I discover a failure reason. For example: I would like to be
emailed if an operation fails due to a database disconnection.
save() function return only true or
If you do $db =
ConnectionManager::getDataSource($this-Model-useDbConfig), that will
give you a reference to the database connection object, from which you
can retrieve query and connection errors.
--~--~-~--~~~---~--~~
You received this message because you are
56 matches
Mail list logo