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 NotFoundE
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 t
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 it
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 = ConnectionManager::getDataSource('another')
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 handle
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 simple
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:
>
>
> There was a problem processing your request.
>
>
> Anytime something goes w
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:
There was a problem processing your request.
Anytime something goes wrong when something is accessed via REST (e.g.
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 wrote:
> On Wed, Nov 10, 2010 at 4:42 AM, Stephen
> wrote:
> > Thanks for the advice cricket.
> >
> >
On Wed, Nov 10, 2010 at 4:42 AM, Stephen 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' => Configure::read('SomeKey'), ...);
>
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 figur
On Tue, Nov 9, 2010 at 4:14 AM, Stephen 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 AppController which contains quite
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 dis
caught exception 'Exception' with message
> 'something' ....
>
> After digging 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 ret
Fatal error: Uncaught 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
gt;
> > 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 othe
/class/object
-teh
On May 23, 2:51 pm, Luiz Poleto 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
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 l
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
woul
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 wrote:
> My previous comment was incorrect, you can easily override
> ErrorHandler methods by creating app_error.php and AppError extends
>
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:
Ideally cake would support a debug level of between production and
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, mscde
On Mar 3, 7:28 pm, mscdex wrote:
> On Mar 3, 1:08 pm, Aidan Lister 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 that permits to
log errors and n
On Mar 3, 1:08 pm, Aidan Lister 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 the Google Groups
"Ca
7:52 am, Aidan Lister 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
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 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
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 develop
On Wed, Dec 17, 2008 at 2:10 PM, Rob Wilkerson 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 code still returns the
On Wed, Dec 17, 2008 at 1:48 PM, Rob 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 sec
gt; the source 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
>
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
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
> anot
meone 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 de
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:
>
>&g
ROTECTED]> 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
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
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
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
"CakePH
ay 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
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 t
Hello guys,
I was wondering whether it's possible to catch error message and error code
(if any), when trying to perform any action in cake.
Let me explain better:
Suppose i called a $this->save() method and it didn't save for any reason.
Instead of display an error to the user, i would like to log
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?
tha
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.
>
> class PostsController extends AppController {
>
> var $name = 'Posts';
> var $helpers = array('Htm
let's see a scene:
i have a Posts controller, and the controller has a view action.
Session->setFlash(__('Invalid Post.', true));
$this->redirect(array('action'=>'index'));
}
$this->set('post', $post = $this->Post->read(null, $id););
אחי טעית ושלחת לי בטעות (:
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]
>
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
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 PROTEC
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 sidebar
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
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 of
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
> >
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,
an
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?
> >
> >
On 5/10/07, Greg Cerveny <[EMAIL PROTECTED]> wrote:
>
>
> Which is better?
>
> if ($this->User->save($this->data)){
> $this->flash('Password updated, please login
> again.','/users/logout');
> } else {
> $this->render();
> }
>
> or just:
>
> if ($this->User->save($this->data)){
>
Which is better?
if ($this->User->save($this->data)){
$this->flash('Password updated, please login again.','/users/logout');
} else {
$this->render();
}
or just:
if ($this->User->save($this->data)){
$this->flash('Password updated, please login again.','/users/logout');
}
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 ex
Yup,
that helped, thanks a lot!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL P
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
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
60 matches
Mail list logo