Commit graph

161 commits

Author SHA1 Message Date
mark_story
cfbc43671e Starting content type specific error pages.
- Adding RequestHandler to the error controller.  This allows reuse
  of all of Cake's internals.
- Adding a simple JsonView class to do serialized JSON views.
- Adding serialize hooks, and wiring things together.
2011-11-27 23:51:47 -05:00
mark_story
21cd3f00ac Merge branch '2.0' into 2.1
Conflicts:
	lib/Cake/Test/Case/BasicsTest.php
2011-11-19 20:40:07 -05:00
mark_story
3e2f8ddf98 CakeException subclasses render correctly now.
CakeException subclasses without their own view files, would trigger
a MissingViewException, which would result in no application helpers
being used.  This could cause issues when app helpers are used
in the layout.

Instead a error500 template is rendered using app helpers.

Fixes #2274, fixes #2004
2011-11-19 20:25:20 -05:00
Rachman Chavik
408e785d5e Display datasource name in exceptions and error page.
When working with multiple databases, it's helpful to display
the datasource name that is requested by a given model.
2011-11-17 11:24:45 +07:00
mark_story
18a34c03a4 Fix issue where unknown exceptions would be squashed.
Fix issue where unknown exceptions with error codes that were not
in HTTP ranges would be ignored.  In development those messages
should display.

Fixes #2205
2011-11-02 21:21:48 -04:00
mark_story
d62351eb36 Revert the changes done to remove the 'cake' domain
After some discussion, polutting the app POT file
with unchanging Cake strings was incorrect.  Having these
strings in a separate POT file allows reuse of translations across
projects.

Refs #2103
2011-10-23 20:36:31 -04:00
Majna
a9dbde0cbd Fixing incorrect doc blocks regarding error handler. 2011-10-23 21:55:20 +02:00
Renan Gonçalves
1cf67b1e55 Little cleanup in exceptions.
- Removed duplicated or non-used exceptions.
- Making the error messages more descriptive and stardard.
2011-10-15 20:08:02 +02:00
mark_story
6bf6d79979 Removing 'cake' domain from core.
This domain was supposed to be replaced by cake_dev.
There are a number of translations that should be App land as well.
Such as those in helpers.

Fixes #2103
2011-10-14 21:01:17 -04:00
mark_story
aa7448e3ed Fixing incorrect exit codes on console exceptions.
Uncaught exceptions on the console would result in exit code 0.
This is not helpful in *nix scripting.

- Update the ConsoleErrorHandler to not inherit from the web error handler.
- Make ErrorHandler::_mapErrorCode() public as it isn't overly private.
- Make ConsoleErrorHandler methods instance methods so mocking can be done.
- Add a _stop method to correctly exit.
- Update tests.
2011-10-03 22:48:50 -04:00
mark_story
421a2116be Adding error code checking around CakeException handling
SocketExceptions can have error codes outside of the HTTP values.
2011-09-27 20:39:32 -04:00
ADmad
670fea6e37 Fixing doc block 2011-09-18 19:58:47 +05:30
Jose Lorenzo Rodriguez
3d0af8b690 Adding a new exception renderer method to show useful error for failed queries 2011-09-04 04:50:19 -04:30
mark_story
cc8d44f21f Adding an exception for when a PDO interface is not installed. 2011-09-03 17:03:31 +01:00
Juan Basso
16ef234180 Removing trailing spaces. 2011-08-15 23:55:08 -04:00
Juan Basso
895c10af7b Adjusted some types in @param, @return and @var. 2011-07-31 22:57:17 -04:00
Juan Basso
ebb70c4810 Fixed type to parameters that is defined in the code. 2011-07-31 18:03:28 -04:00
Juan Basso
9bc3e567c1 Removed the @access and @static. 2011-07-30 20:56:48 -04:00
Juan Basso
3723f7d396 Fixed some API doc in controllers and errors. 2011-07-30 16:48:37 -04:00
Juan Basso
a0ee8b49fe Fixed some API doc in console. 2011-07-28 22:05:29 -04:00
Jose Lorenzo Rodriguez
cfd2d9e00b Updating all @package annotations in doc blocks 2011-07-26 01:46:14 -04:30
mark_story
04147caca8 Updating ExceptionRenderer and CakeErrorHandler for Controller changes. 2011-07-22 20:29:44 -04:00
Majna
742130b540 Fix for wrong Exception messages and typos. Added missing ExceptionRenderer tests for Datasource 2011-07-07 19:36:21 +02:00
Juan Basso
1c7d54eacc Updated the paths from comments. 2011-06-19 20:28:40 -04:00
Juan Basso
192812ee7f Updating the copyright to 2011. 2011-05-30 22:32:43 -04:00
ADmad
4c042ae133 Adding proper visibility keywords for class functions 2011-05-29 03:31:34 +05:30
Ceeram
26588827dc Fix incorrect exceptions message for missing plugins 2011-05-26 16:24:54 +02:00
Thomas Ploch
d8a614e112 Added usage of configured error handler instead of hard coded. Moved try/catch block to where its nessecary. Set Configure::write('Error.trace', false) since its useless with internals. Addition to #1707 . 2011-05-17 08:44:55 +02:00
mark_story
2bc58a5abd Added check if Router::getRequest(false) is returning a CakeRequest or null in ExceptionRenderer::_getController(). Fixes 'call to undefined method here()' when having Exceptions raised without valid request set to the Router in testsuite (i.e. undefined database config 'test'). Fixes #1678 .
Conflicts:

	lib/Cake/Error/ExceptionRenderer.php
2011-05-16 21:11:33 -04:00
Thomas Ploch
085c621c0e Added try/catch block into ErrorHandler::handleException() to gracefully show Exceptions raised during exception handling. Fixes #1707 2011-05-16 20:53:38 -04:00
AD7six
e95d6a3b10 case correction, fixes ExceptionRenderer test 2011-05-17 00:08:51 +02:00
Jose Lorenzo Rodriguez
77788a965d Merge remote-tracking branch 'origin/2.0' into 2.0-plugin-loader
Conflicts:
	lib/Cake/tests/test_app/plugins/TestPlugin/Model/test_plugin_post.php
	lib/Cake/tests/test_app/plugins/test_plugin/Model/TestPluginPost.php
	lib/Cake/tests/test_app/plugins/test_plugin/Model/test_plugin_post.php
2011-05-08 22:08:31 -04:30
mark_story
b31f25fb8b Fixing issues rendering repeat errors coming from the rendering of an error page (like a missing helper).
Test added. Fixes #1671
2011-04-25 21:09:53 -04:00
Jose Lorenzo Rodriguez
dfb669ab8e Allowing plugins to offer ExceptionRenderer classes 2011-04-24 00:56:48 -04:30
Jose Lorenzo Rodriguez
64db00706e Merge remote branch 'origin/2.0' into 2.0-plugin-loader 2011-04-23 23:25:31 -04:30
Juan Basso
24fbaafe01 Merge with 2.0-email. 2011-04-23 22:36:55 -04:00
Jose Lorenzo Rodriguez
c504535980 Stating to implement a CakePlugin class to allow the inclusion of bootraping files for plugins 2011-04-17 01:37:31 -04:30
mark_story
a7a076dbee Fixing ExceptionRenderer so it can render exceptions that are subclasses
of CakeException that do not have custom templates, like ConfigureException.
Removing $lastError as it doesn't work.
Added tests.
2011-04-16 18:13:52 -04:00
Juan Basso
a92092231c Throwing exception when headers is not an array. 2011-04-12 22:15:11 -04:00
Jose Lorenzo Rodriguez
75a1481e22 Fixing test loading in cli 2011-04-11 22:23:03 -04:30
AD7six
32df3156a7 consolidate cake_error and cake_developer to simply "cake_dev"
it's a lot easier for adding new translations to think:
	is it for the end user?
		use 'cake' as the domain
	is it for the developer
		use 'cake_dev' as the domain
	is it for the console
		use 'cake_console' as the domain

also neatly avoids the "this message is an error, and it's in
cake_developer, why?" - question (because cake_error was intended for
anything which is used in trigger_error/exceptions, not a variable named
$error
2011-03-20 16:38:31 +01:00
AD7six
b19ca3c95e using the domain cake_error for messages intended for the developer 2011-03-19 18:09:58 +01:00
AD7six
39c7d03319 Merge branch '2.0-class-loading' into 2.0-translations
Conflicts:
	lib/Cake/Console/Command/Task/ControllerTask.php
	lib/Cake/Console/Command/Task/ProjectTask.php
	lib/Cake/Core/Configure.php
	lib/Cake/View/pages/home.ctp
2011-03-16 12:29:39 +01:00
AD7six
4f29f58a5e correct path to tmp and core.php file when running outside your app dir.
also wrapped HttpException class declaraion in an if !class_exists test
- the class exists in the pecl http extension.
2011-03-16 12:13:47 +01:00
AD7six
afc5cd4277 changes in the error dir 2011-03-12 20:00:27 +01:00
Jose Lorenzo Rodriguez
90b01b7ec3 Merge remote-tracking branch 'origin/2.0' into 2.0-class-loading 2011-03-10 23:17:54 -04:30
Jose Lorenzo Rodriguez
f8a08432f4 Merge remote-tracking branch 'origin/2.0' into 2.0-class-loading 2011-03-05 17:37:31 -04:30
José Lorenzo Rodríguez
f8b51bfd92 Making the test suite load again 2011-02-13 23:56:41 -04:30
José Lorenzo Rodríguez
6e4f4efb79 Merge remote branch 'origin/2.0' into 2.0-class-loading
Conflicts:
	cake/bootstrap.php
	lib/Cake/Console/Command/TestSuiteShell.php
	lib/Cake/Console/TaskCollection.php
	lib/Cake/Controller/ComponentCollection.php
	lib/Cake/Controller/Controller.php
	lib/Cake/Core/App.php
	lib/Cake/Model/BehaviorCollection.php
	lib/Cake/Network/CakeRequest.php
	lib/Cake/TestSuite/CakeTestSuiteDispatcher.php
	lib/Cake/TestSuite/CakeWebTestCase.php
	lib/Cake/TestSuite/TestManager.php
	lib/Cake/TestSuite/TestRunner.php
	lib/Cake/View/HelperCollection.php
	lib/Cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php
	lib/Cake/tests/cases/libs/test_manager.test.php
2011-02-13 23:10:19 -04:30
José Lorenzo Rodríguez
024bff2126 Adding missing class usage declaration in ExceptionHandler test case 2011-01-28 01:56:00 -04:30
José Lorenzo Rodríguez
d9c99b5ef6 Merge remote branch 'origin/2.0' into 2.0-class-loading
Conflicts:
	cake/tests/cases/libs/controller_test_case.test.php
	lib/Cake/Controller/ComponentCollection.php
	lib/Cake/Model/ConnectionManager.php
	lib/Cake/TestSuite/Fixture/CakeTestFixture.php
	lib/Cake/View/pages/home.ctp
2011-01-22 01:00:15 -04:30
José Lorenzo Rodríguez
4c0e06c451 Merge remote branch 'origin/2.0' into 2.0-class-loading
Conflicts:
	cake/bootstrap.php
	cake/libs/view/helpers/js.php
	lib/Cake/Model/AclNode.php
	lib/Cake/Model/ConnectionManager.php
	lib/Cake/bootstrap.php
	lib/Cake/tests/cases/libs/controller/controller.test.php
2011-01-02 02:00:03 -04:30
José Lorenzo Rodríguez
07e43bb0f8 Merge remote branch 'origin/2.0' into 2.0-class-loading
Conflicts:
	cake/libs/view/scaffolds/edit.ctp
	cake/libs/view/scaffolds/form.ctp
	cake/tests/test_app/plugins/test_plugin/views/tests/scaffold.edit.ctp
	cake/tests/test_app/plugins/test_plugin/views/tests/scaffold.form.ctp
	cake/tests/test_app/views/posts/scaffold.edit.ctp
	cake/tests/test_app/views/posts/scaffold.form.ctp
	lib/Cake/Error/ErrorHandler.php
	lib/Cake/Model/Behavior/TranslateBehavior.php
	lib/Cake/Model/Datasource/CakeSession.php
	lib/Cake/Routing/Router.php
	lib/Cake/TestSuite/TestManager.php
	lib/Cake/View/scaffolds/edit.ctp
	lib/Cake/tests/cases/console/shells/bake.test.php
	lib/Cake/tests/cases/libs/cake_log.test.php
	lib/Cake/tests/cases/libs/cake_request.test.php
	lib/Cake/tests/cases/libs/view/helpers/number.test.php
	lib/Cake/tests/test_app/plugins/test_plugin/views/tests/scaffold.edit.ctp
	lib/Cake/tests/test_app/views/posts/scaffold.edit.ctp
2010-12-15 01:13:05 -04:30
José Lorenzo Rodríguez
f84351dd07 More replacements of App::import to App::uses 2010-12-09 00:43:11 -04:30
José Lorenzo Rodríguez
b8344ecd33 Replacing some of the App::import by App::uses 2010-12-08 23:15:18 -04:30
José Lorenzo Rodríguez
3f64844de9 Merge remote branch 'origin/2.0' into 2.0-class-loading
Conflicts:
	lib/Cake/Model/ConnectionManager.php
	lib/Cake/basics.php
2010-12-05 23:43:58 -04:30
José Lorenzo Rodríguez
e425b68a86 Loading the CakeErrorController 2010-12-04 15:11:15 -04:30
José Lorenzo Rodríguez
e3f85ccda8 loading the ExceptionRenderer 2010-12-04 14:06:30 -04:30
José Lorenzo Rodríguez
ff8b1a1041 Stating to move loggers to the new folder 2010-12-04 13:50:26 -04:30
José Lorenzo Rodríguez
b4387d2f51 More replacements to get class loaded using the new file scheme 2010-12-04 02:34:30 -04:30
José Lorenzo Rodríguez
73ad5385eb Moving more classes to the new layout, it is time to bring the debugger up 2010-12-04 02:16:51 -04:30