Skip to content

Commit

Permalink
Added uncaught exception handler
Browse files Browse the repository at this point in the history
Improved error messaging
  • Loading branch information
bochoven committed Feb 9, 2014
1 parent 742a2ae commit 2a0e43f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions app/helpers/site_helper.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

// Munkireport version (last number is number of commits)
$GLOBALS['version'] = '2.0.7.678';
$GLOBALS['version'] = '2.0.7.674';

// Return version without commit count
function get_version()
Expand All @@ -14,9 +14,14 @@ function get_version()
//===============================================s
function uncaught_exception_handler($e)
{
ob_end_clean(); //dump out remaining buffered text
$vars['message']=$e;
die(View::do_fetch(APP_PATH.'errors/exception_uncaught.php',$vars));
// Dump out remaining buffered text
ob_end_clean();

// Get error message
error($e->getMessage());

// Write footer
die(View::do_fetch(conf('view_path').'partials/foot.php'));
}

function custom_error($msg='')
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function fatal($msg)
setlocale(LC_ALL, conf('locale'));


//set_exception_handler('uncaught_exception_handler');
set_exception_handler('uncaught_exception_handler');

//===============================================
// Quick permissions check for sqlite operations
Expand Down

0 comments on commit 2a0e43f

Please sign in to comment.