Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable exception mode for PDO Saver #325

Merged
merged 2 commits into from
Sep 15, 2020
Merged

Enable exception mode for PDO Saver #325

merged 2 commits into from
Sep 15, 2020

Conversation

glensc
Copy link
Contributor

@glensc glensc commented Sep 14, 2020

Fixes problem that PDO errors are not caught: #322

@athoune
Copy link

athoune commented Sep 14, 2020

/run/import works well, but /run/view?id=5f5fcc1b2c5ff69b332f9a98 crash :

Type: ErrorException
Code: 2
Message: Invalid argument supplied for foreach()
File: /var/www/src/Xhgui/Profile.php
Line: 365
Trace

#0 /var/www/src/Xhgui/Profile.php(365): Slim\Slim::handleErrors(2, 'Invalid argumen...', '/var/www/src/Xh...', 365, Array)
#1 /var/www/src/Xhgui/Controller/Run.php(97): Xhgui_Profile->calculateSelf()
#2 /var/www/src/routes.php(30): Xhgui_Controller_Run->view()
#3 [internal function]: {closure}()
#4 /var/www/vendor/slim/slim/Slim/Route.php(468): call_user_func_array(Object(Closure), Array)
#5 /var/www/vendor/slim/slim/Slim/Slim.php(1355): Slim\Route->dispatch()
#6 /var/www/vendor/slim/slim/Slim/Middleware/Flash.php(85): Slim\Slim->call()
#7 /var/www/vendor/slim/slim/Slim/Middleware/MethodOverride.php(92): Slim\Middleware\Flash->call()
#8 /var/www/vendor/slim/slim/Slim/Middleware/SessionCookie.php(110): Slim\Middleware\MethodOverride->call()
#9 /var/www/src/Xhgui/Middleware/Render.php(11): Slim\Middleware\SessionCookie->call()
#10 /var/www/vendor/slim/slim/Slim/Middleware/PrettyExceptions.php(67): Xhgui_Middleware_Render->call()
#11 /var/www/vendor/slim/slim/Slim/Slim.php(1300): Slim\Middleware\PrettyExceptions->call()
#12 /var/www/webroot/index.php(10): Slim\Slim->run()
#13 {main}

Having it in save() method is asymmetric and prevents save being called
more than once per request.
@glensc glensc changed the title Improve portability of PDO saver Enable exception mode for PDO Saver Sep 15, 2020
@glensc glensc merged commit cbb6c8e into master Sep 15, 2020
@glensc glensc deleted the 322-pdo branch September 15, 2020 00:37
@glensc glensc mentioned this pull request Sep 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants