diff --git a/gulliver/system/class.controller.php b/gulliver/system/class.controller.php index f61e25eaf..3e6eccf4d 100755 --- a/gulliver/system/class.controller.php +++ b/gulliver/system/class.controller.php @@ -129,20 +129,17 @@ class Controller print G::json_encode( $result ); } } catch (Exception $e) { + $result = new StdClass(); if ($this->responseType != 'json') { - $result->exception->class = get_class( $e ); - $result->exception->code = $e->getCode(); - - $template = new TemplatePower( PATH_TEMPLATE . 'controller.exception.tpl' ); - $template->prepare(); - $template->assign( 'controller', (function_exists( 'get_called_class' ) ? get_called_class() : 'Controller') ); - $template->assign( 'message', $e->getMessage() ); - $template->assign( 'file', $e->getFile() ); - $template->assign( 'line', $e->getLine() ); - $template->assign( 'trace', $e->getTraceAsString() ); - - echo $template->getOutputContent(); - + Bootstrap::renderTemplate('controller.exception.tpl', array( + 'title' => 'Controller Exception', + 'message' => nl2br($e->getMessage()), + 'controller' => (function_exists( 'get_called_class' ) ? get_called_class() : 'Controller'), + 'exceptionClass' => get_class($e), + 'file' => $e->getFile(), + 'line' => $e->getLine(), + 'trace' => $e->getTrace() + )); } else { $result->success = false; $result->msg = $e->getMessage(); diff --git a/gulliver/templates/controller.exception.tpl b/gulliver/templates/controller.exception.tpl index 3e77268e5..37eb9a27b 100755 --- a/gulliver/templates/controller.exception.tpl +++ b/gulliver/templates/controller.exception.tpl @@ -1,55 +1,100 @@ - - + + - -Server Error :: + + + Whoops, looks like something went wrong. + - - -
- -
-
- - - - -
- CONTROLLER EXCEPTION
-
- {message}

- Controller: {controller}
- File: {file}
- Line: {line} -
-
- - - -
{trace}
-
+
+

{$controller} {$title}

+
+

+ {$exceptionClass}: {$message} +

+
+
+ Controller: {$controller}
+ File: {$file}
+ Line: {$line} +
    + {foreach from=$trace item=line} + {if $line.class} +
  1. At {$line.class}{$line.type}{$line.function}()
    in {$line.file} line {$line.line}
  2. + {else} +
  3. At {$line.function}() in {$line.file} line {$line.line}
  4. + {/if} + {/foreach} +
+
- \ No newline at end of file + + + + + + + + + + diff --git a/workflow/engine/controllers/designer.php b/workflow/engine/controllers/designer.php index 381441769..2f247588e 100644 --- a/workflow/engine/controllers/designer.php +++ b/workflow/engine/controllers/designer.php @@ -39,10 +39,10 @@ class Designer extends Controller if (System::isDebugMode()) { if (! file_exists(PATH_HTML . "lib-dev/pmUI/build.cache")) { - throw new Exception("Error: Development JS Files were are not generated!, please execute: \$rake pmBuildDebug in pmUI project"); + throw new RuntimeException("Development JS Files were are not generated!.\nPlease execute: \$>rake pmBuildDebug in pmUI project"); } if (! file_exists(PATH_HTML . "lib-dev/mafe/build.cache")) { - throw new Exception("Error: Development JS Files were are not generated!, please execute: \$rake pmBuildDebug in MichelangeloFE project"); + throw new RuntimeException("Development JS Files were are not generated!.\nPlease execute: \$>rake pmBuildDebug in MichelangeloFE project"); } $mafeFiles = file(PATH_HTML . "lib-dev/mafe/build.cache", FILE_IGNORE_NEW_LINES);