Answers.Body: <p>Definitely agree with the comments that you should enable <code>devMode</code> from day one when working on a project. In addition, coding defensively can help avoid common frontend errors as well.</p>
  
  <p>There's more on this topic in the article <a href="https://nystudio107.com/blog/handling-errors-gracefully-in-craft-cms" rel="nofollow noreferrer">Handling Errors Gracefully in Craft CMS</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-20T19:42:49.433Z
Answers.LastActivityDate: 2017-11-20T19:42:49.433Z
Answers.UserDisplayName: andrew.welch
Body: <p>We started getting this error inconsistently on our site, and now it's constant unless we turn devMode off. We have no idea what may be causing it, but it only happens on one page. With devMode turned off, this page loads as intended with no issues. Here's a stack trace of what's coming through:</p>
  
  <pre><code>Class 'Exception\RuntimeException' not found
  /craft/app/framework/vendors/zend-escaper/Escaper.php(321)
  /craft/app/framework/vendors/zend-escaper/Escaper.php(182): Escaper-&gt;toUtf8("[11:24:06.471][trace][system.db.CDbCommand] Executing SQL: UPDAT...")
  /craft/app/framework/web/helpers/CJavaScript.php(35): Escaper-&gt;escapeJs("[11:24:06.471][trace][system.db.CDbCommand] Executing SQL: UPDAT...")
  /craft/app/helpers/LoggingHelper.php(51): CJavaScript::quote("[11:24:06.471][trace][system.db.CDbCommand] Executing SQL: UPDAT...")
  /craft/app/templates/logging/log-firebug.php(46): Craft\LoggingHelper::processFireBugLogEntry("trace", "11:24:06.471", "system.db.CDbCommand", "Executing SQL: UPDATE `craft_budhub_spend_analytics` SET `id`=:y...", ...)
  /craft/app/framework/logging/CWebLogRoute.php(52): Craft\WebLogRoute-&gt;render("log", array(array("Loading "cache" application component in /var/www/thisisbud.dev/...", "trace", "system.CModule", 1499945046.3493, ...), array("Loading "path" application component in /var/www/thisisbud.dev/c...", "trace", "system.CModule", 1499945046.3495, ...), array("Loading "request" application component in /var/www/thisisbud.de...", "trace", "system.CModule", 1499945046.3497, ...), array("Serving "usePathInfo" from cache in /var/www/thisisbud.dev/craft...", "trace", "system.caching.Craft\FileCache", 1499945046.3501, ...), ...))
  /craft/app/framework/logging/CLogRoute.php(104): CWebLogRoute-&gt;processLogs(array(array("$_COOKIE=array ( 'ccc7c40e11a9bcf94cb9cc672f7748a0username' =&gt;...", "info", "application", 1499945046.3467), array("Loading "cache" application component in /var/www/thisisbud.dev/...", "trace", "system.CModule", 1499945046.3493, ...), array("Loading "path" application component in /var/www/thisisbud.dev/c...", "trace", "system.CModule", 1499945046.3495, ...), array("Loading "request" application component in /var/www/thisisbud.de...", "trace", "system.CModule", 1499945046.3497, ...), ...))
  </code></pre>
  
  <p>A few points that may help:</p>
  
  <ul>
  <li>We are accessing and saving (encrypted) binary data to the DB, though we do this elsewhere on the site without issue.</li>
  <li>The twig being loaded loads other pages too, which all run fine seperately</li>
  <li>DevMode turned off, we can't see anything that's not working, but with devMode on, it's impossible to get past said error.</li>
  </ul>
  
  <p>We've been wrestling with this for a while without any luck. Any help would be greatly appreciated!</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-07-13T12:54:58.983Z
Comments.Text: Got a tip for the next project. Start using devmode from the beginning so you know what code gives the error.
Comments.UserDisplayName: Justin Dekkers
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-07-13T12:55:43.577Z
Comments.Text: Does it happen on all pages though or just a couple? If so check which code is used on all those pages and not on any other so you atleast know where it goes wrong
Comments.UserDisplayName: Justin Dekkers
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-07-13T13:20:25.747Z
Comments.Text: @JustinDekkers Thanks for your response. We've been working on this project for 2 years and it is live and well as a production site. We've had devmode enabled from the beginning on our development environments (everywhere but our production boxes). We haven't just on a whim enabled devMode, this is an error that popped up out of nowhere and we can't identify why. The page it has shown up on _used_ to work.
Comments.UserDisplayName: Merlin
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-07-13T22:49:59.827Z
Comments.Text: Pretty sure this is a bug.  Can you try this fix and see if that resolves it for you? https://github.com/yiisoft/yii/commit/7944ca5c6f246b22a6c24bdc8ab3e0f6c9c7fcbc
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-07-14T09:50:54.560Z
Comments.Text: @BradBell Well.. that changed the error page to just an Exception with no error message! Feels like we're getting closer?
Comments.UserDisplayName: Merlin
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-07-14T19:00:24.147Z
Comments.Text: Any chance there is a public box you can reproduce this on and wouldn't mind sending CP/FTP creds over to support@craftcms.com?
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-08-07T10:09:29.647Z
Comments.Text: I had the same issue even before running the installer. After some trail & error, I was able to fix it by clearing my cookies from the (local) domain.
Comments.UserDisplayName: Diederik
Tags: <error><devmode>
Title: DevMode Class 'Exception\RuntimeException' not found
ThreadText: # DevMode Class 'Exception\RuntimeException' not found
  
  (Asked by: username_0 on 2017-07-13)
  
  We started getting this error inconsistently on our site, and now it's constant unless we turn devMode off. We have no idea what may be causing it, but it only happens on one page. With devMode turned off, this page loads as intended with no issues. Here's a stack trace of what's coming through:
  
  ```
  Class 'Exception\RuntimeException' not found
  /craft/app/framework/vendors/zend-escaper/Escaper.php(321)
  /craft/app/framework/vendors/zend-escaper/Escaper.php(182): Escaper->toUtf8("[11:24:06.471][trace][system.db.CDbCommand] Executing SQL: UPDAT...")
  /craft/app/framework/web/helpers/CJavaScript.php(35): Escaper->escapeJs("[11:24:06.471][trace][system.db.CDbCommand] Executing SQL: UPDAT...")
  /craft/app/helpers/LoggingHelper.php(51): CJavaScript::quote("[11:24:06.471][trace][system.db.CDbCommand] Executing SQL: UPDAT...")
  /craft/app/templates/logging/log-firebug.php(46): Craft\LoggingHelper::processFireBugLogEntry("trace", "11:24:06.471", "system.db.CDbCommand", "Executing SQL: UPDATE `craft_budhub_spend_analytics` SET `id`=:y...", ...)
  /craft/app/framework/logging/CWebLogRoute.php(52): Craft\WebLogRoute->render("log", array(array("Loading "cache" application component in /var/www/thisisbud.dev/...", "trace", "system.CModule", 1499945046.3493, ...), array("Loading "path" application component in /var/www/thisisbud.dev/c...", "trace", "system.CModule", 1499945046.3495, ...), array("Loading "request" application component in /var/www/thisisbud.de...", "trace", "system.CModule", 1499945046.3497, ...), array("Serving "usePathInfo" from cache in /var/www/thisisbud.dev/craft...", "trace", "system.caching.Craft\FileCache", 1499945046.3501, ...), ...))
  /craft/app/framework/logging/CLogRoute.php(104): CWebLogRoute->processLogs(array(array("$_COOKIE=array ( 'ccc7c40e11a9bcf94cb9cc672f7748a0username' =>...", "info", "application", 1499945046.3467), array("Loading "cache" application component in /var/www/thisisbud.dev/...", "trace", "system.CModule", 1499945046.3493, ...), array("Loading "path" application component in /var/www/thisisbud.dev/c...", "trace", "system.CModule", 1499945046.3495, ...), array("Loading "request" application component in /var/www/thisisbud.de...", "trace", "system.CModule", 1499945046.3497, ...), ...))
  
  ```
  
  A few points that may help:
  
  * We are accessing and saving (encrypted) binary data to the DB, though we do this elsewhere on the site without issue.
  * The twig being loaded loads other pages too, which all run fine seperately
  * DevMode turned off, we can't see anything that's not working, but with devMode on, it's impossible to get past said error.
  
  We've been wrestling with this for a while without any luck. Any help would be greatly appreciated!
  
  **Tags:** error, devmode
  
  > **Comments:**
  > **username_1**: Got a tip for the next project. Start using devmode from the beginning so you know what code gives the error.  
  > **username_1**: Does it happen on all pages though or just a couple? If so check which code is used on all those pages and not on any other so you atleast know where it goes wrong  
  > **username_0**: @username_1 Thanks for your response. We've been working on this project for 2 years and it is live and well as a production site. We've had devmode enabled from the beginning on our development environments (everywhere but our production boxes). We haven't just on a whim enabled devMode, this is an error that popped up out of nowhere and we can't identify why. The page it has shown up on _used_ to work.  
  > **username_2**: Pretty sure this is a bug.  Can you try this fix and see if that resolves it for you? https://github.com/yiisoft/yii/commit/7944ca5c6f246b22a6c24bdc8ab3e0f6c9c7fcbc  
  > **username_0**: @username_2 Well.. that changed the error page to just an Exception with no error message! Feels like we're getting closer?  
  > **username_2**: Any chance there is a public box you can reproduce this on and wouldn't mind sending CP/FTP creds over to support@craftcms.com?  
  > **username_3**: I had the same issue even before running the installer. After some trail & error, I was able to fix it by clearing my cookies from the (local) domain.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_4 on 2017-11-20. Score: 1
  
  Definitely agree with the comments that you should enable `devMode` from day one when working on a project. In addition, coding defensively can help avoid common frontend errors as well.
  
  There's more on this topic in the article [Handling Errors Gracefully in Craft CMS](https://nystudio107.com/blog/handling-errors-gracefully-in-craft-cms)
  
  
  ---
  
  