Skip to content

Commit

Permalink
error handling at artisan up
Browse files Browse the repository at this point in the history
  • Loading branch information
match committed Jun 8, 2019
1 parent 6563c2e commit 6082be0
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/Illuminate/Foundation/Console/UpCommand.php
Expand Up @@ -2,6 +2,7 @@

namespace Illuminate\Foundation\Console;

use Exception;
use Illuminate\Console\Command;

class UpCommand extends Command
Expand All @@ -27,8 +28,19 @@ class UpCommand extends Command
*/
public function handle()
{
@unlink(storage_path('framework/down'));
try {
if (! file_exists(storage_path('framework/down'))) {
$this->comment('Application is already up.');

$this->info('Application is now live.');
return true;
}
unlink(storage_path('framework/down'));
$this->info('Application is now live.');
} catch (Exception $e) {
$this->error('Application is failed to up.');
$this->error($e->getMessage());

return false;
}
}
}

0 comments on commit 6082be0

Please sign in to comment.