# PDOException - Get error instead rendering error page

**URL:** <https://discourse.cakephp.org/t/pdoexception-get-error-instead-rendering-error-page/7588>\
**Category:** Need Help\
**Created:** [April 3, 2020, 10:23am UTC](https://discourse.cakephp.org/t/pdoexception-get-error-instead-rendering-error-page/7588 "2020-04-03T10:23:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlzGamer](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/alzgamer/32/2144_2.png) [@AlzGamer](https://discourse.cakephp.org/u/AlzGamer)\
**Post date:** [April 3, 2020, 10:23am UTC](https://discourse.cakephp.org/t/pdoexception-get-error-instead-rendering-error-page/7588/1 "2020-04-03T10:23:21Z")

</div>

Hello.  
I need to check _sql_, and got `false` or error code/message to controller instead rendering error page when try to `execute()` _sql_. I’m not found it in documentations _(Error & Exception Handling)_, how I can do it?  
Thank you.

> CakePHP 3.8

---

<div class="post-metadata">

**Author:** ![dreamingmind](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/dreamingmind/32/1857_2.png) [@dreamingmind](https://discourse.cakephp.org/u/dreamingmind)\
**Post date:** [April 3, 2020, 4:03pm UTC](https://discourse.cakephp.org/t/pdoexception-get-error-instead-rendering-error-page/7588/2 "2020-04-03T16:03:33Z")

</div>

Is this a raw SQL query your trying to run or a Cake Query?

If it’s raw SQL you could try and run it in some other tool to see what you get. I happen to use SequelPro but have no recommendations to give.

If it’s a Cake query, once you’ve defined it and before you force it to execute you can debug the query to the screen to see what it looks like.
