laravel异常相关

1.在Console/Commands 脚本文件中,handle()方法里给命令行在执行中的提示
$this->line() 简单的输出(白色)
$this->info() 绿色输出,可代表完成
$this->error() 红色的输出,可代表抛错

2.关于try catch使用
try{
throw new Exception('出错');
throw new OtherException('出错');
}catch(\Exception $e){
return $e->getMessage();
}catch(\OtherException $e){
return $e->getMessage();
}

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容