Cakephp error handling goes haywire after Controller::viewVars and filtered through htmlentities

2014-10-21 Thread Hussain Shafeeu
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

Error Handling

2014-02-07 Thread Advantage+
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

Re: error handling: how to handle missing secondary database gracefully

2012-02-09 Thread qwanta
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

Re: error handling: how to handle missing secondary database gracefully

2012-02-08 Thread majna
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 =

error handling: how to handle missing secondary database gracefully

2012-02-07 Thread qwanta
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

Re: REST Error Handling

2012-01-03 Thread Matteo Landi
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

Re: REST Error Handling

2012-01-03 Thread Thomas Ploch
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

REST Error Handling

2012-01-02 Thread Will
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

Re: Error Handling (Debug 0)

2010-11-10 Thread Stephen
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

Re: Error Handling (Debug 0)

2010-11-10 Thread cricket
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' =

Re: Error Handling (Debug 0)

2010-11-10 Thread Stephen
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

Error Handling (Debug 0)

2010-11-09 Thread Stephen
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

Re: Error Handling (Debug 0)

2010-11-09 Thread cricket
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

Re: Handling Exceptions Cake's Custom Error Handling

2009-11-16 Thread majna
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

Handling Exceptions Cake's Custom Error Handling

2009-11-14 Thread Tyler Rooney
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

Re: Error Handling

2009-05-25 Thread Luiz Poleto
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

Error Handling

2009-05-23 Thread Luiz Poleto
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

Re: Error Handling

2009-05-23 Thread Teh Treag
/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

Question about Error handling

2009-05-22 Thread marco.rizze...@gmail.com
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

Re: Error handling in production

2009-03-05 Thread byqsri
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

Re: Error handling in production

2009-03-04 Thread byqsri
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

Re: Error handling in production

2009-03-04 Thread Aidan Lister
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,

Re: Error handling in production

2009-03-04 Thread Aidan Lister
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

Re: Error handling in production

2009-03-03 Thread Aidan Lister
, 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

Re: Error handling in production

2009-03-03 Thread mscdex
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

Re: Error handling in production

2009-03-02 Thread dr. Hannibal Lecter
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

Error handling in production

2009-03-01 Thread Aidan Lister
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

Error Handling in 1.2?

2008-12-17 Thread Rob Wilkerson
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

Re: Error Handling in 1.2?

2008-12-17 Thread Rob
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

Re: Error Handling in 1.2?

2008-12-17 Thread Rob Wilkerson
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

Re: Error Handling in 1.2?

2008-12-17 Thread Rob Wilkerson
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

Problem on Error Handling with CAKEPHP

2008-10-29 Thread [EMAIL PROTECTED]
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

Re: Problem on Error Handling with CAKEPHP

2008-10-29 Thread teknoid
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

Re: Problem on Error Handling with CAKEPHP

2008-10-29 Thread Bernardo Vieira
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

Re: Problem on Error Handling with CAKEPHP

2008-10-29 Thread [EMAIL PROTECTED]
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

Re: Problem on Error Handling with CAKEPHP

2008-10-29 Thread marco.rizze...@gmail.com
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

Disabling Cake's error handling for CLI commands.

2008-10-25 Thread Mathew
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

Re: Disabling Cake's error handling for CLI commands.

2008-10-25 Thread Mathew
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

Re: Disabling Cake's error handling for CLI commands.

2008-10-25 Thread Gwoo
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

Re: Error handling

2008-09-12 Thread Donkeybob
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

Error Handling

2008-08-27 Thread [EMAIL PROTECTED]
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

about url error handling

2008-06-26 Thread rain
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) {

Re: about url error handling

2008-06-26 Thread rain
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',

Having problems with custom error handling (auth system), any1 mind helping?

2008-02-04 Thread [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] if(isset($this-actionPermissions)) { //Same case if

Re: Having problems with custom error handling (auth system), any1 mind helping?

2008-02-04 Thread שיר חכמו
אחי טעית ושלחת לי בטעות (: 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]

Error Handling in Ajax Forms

2007-08-10 Thread [EMAIL PROTECTED]
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

Re: Error Handling in Ajax Forms

2007-08-10 Thread francky06l
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

Error Handling for big sites.

2007-08-08 Thread phpjoy
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?

Re: Error Handling

2007-07-13 Thread Dr. Tarique Sani
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

Error Handling

2007-07-13 Thread Ski
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

Re: error handling style

2007-05-11 Thread Gonzalo Servat
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

Re: error handling style

2007-05-11 Thread Greg Cerveny
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

Re: error handling style

2007-05-10 Thread Greg Cerveny
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

Implementing error handling

2006-11-28 Thread maxmil
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

error handling in Cake

2006-04-10 Thread sawa
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

Re: error handling in Cake

2006-04-10 Thread nate
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