Skip to content

Commit

Permalink
updated 404 and 500 responses
Browse files Browse the repository at this point in the history
  • Loading branch information
nikirago committed Jan 28, 2020
1 parent 04eb6db commit 827b46f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
4 changes: 0 additions & 4 deletions .gitignore

This file was deleted.

2 changes: 1 addition & 1 deletion .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
RewriteEngine on

# set directory to FSL Install if your app is in a subfolder else set this to /
RewriteBase /
RewriteBase /gitprojects/dad-jokes_microservice

# test string is a valid files
RewriteCond %{SCRIPT_FILENAME} !-f
Expand Down
2 changes: 1 addition & 1 deletion config/fsl_config.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function configure()
{
option('fsl_version', "0.14");
option('env', ENV_DEVELOPMENT);
option('base_uri', "/"); //set if app is not in web root directory but in a subdirectory.
option('base_uri', "/gitprojects/dad-jokes_microservice"); //set if app is not in web root directory but in a subdirectory...
option('session', 'fsl'); // enable with a specific session name

//##############################################
Expand Down
15 changes: 13 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,21 @@ function html_welcome($vars){ extract($vars);?>
# custom error declaration
##############################################################################
#
// Custom 404 error example
// Custom 404
function not_found($errno, $errstr, $errfile, $errline){

echo "<center><img src=" . url_for('//_lim_public/img/404.gif') . " style='box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);'><BR><BR>Your request for " . $errstr . " came up ghosts.</center>" ;
$arr = array('Error' => "$errno $errstr Not Found");
// status(202); //returns HTTP status code of 202
status(404); //returns HTTP status code of 202
return json($arr);
}
// Custom 500
function server_error($errno, $errstr, $errfile, $errline){

$arr = array('Error' => "$errno $errstr ");
// status(202); //returns HTTP status code of 202
status(500); //returns HTTP status code of 202
return json($arr);
}


Expand Down

0 comments on commit 827b46f

Please sign in to comment.