Browse Source

improve error message, hide realpath of layout file

master
filesite 3 years ago
parent
commit
151ec0c27b
  1. 6
      controller/Controller.php
  2. 4
      lib/FSC.php

6
controller/Controller.php

@ -47,7 +47,11 @@ Class Controller {
ob_end_flush(); ob_end_flush();
}else { }else {
throw new Exception("Layout file not exist: {$layoutFile}", 500); $error_message = "Layout file {$this->layout}.php is not exist.";
if (!empty(FSC::$app['config']['theme'])) {
$error_message = "Layout file {$this->layout}.php in theme " . FSC::$app['config']['theme'] . " is not exist.";
}
throw new Exception($error_message, 500);
} }
} }

4
lib/FSC.php

@ -98,9 +98,9 @@ Class FSC {
throw new Exception($error_message, 500); throw new Exception($error_message, 500);
} }
}else { }else {
$error_message = "Controller {$className} not exist."; $error_message = "Controller {$className}.php not exist.";
if (!empty($config['theme'])) { if (!empty($config['theme'])) {
$error_message = "Controller {$className} not exist in theme {$config['theme']}."; $error_message = "Controller {$className}.php not exist in theme {$config['theme']}.";
} }
throw new Exception($error_message, 500); throw new Exception($error_message, 500);
} }

Loading…
Cancel
Save