Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PlazaLazoJorge_2022_backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jorplaz
PlazaLazoJorge_2022_backend
Merge requests
!3
Develop
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Develop
develop
into
main
Overview
0
Commits
7
Pipelines
0
Changes
49
Merged
jorplaz
requested to merge
develop
into
main
2 years ago
Overview
0
Commits
7
Pipelines
0
Changes
49
Expand
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
ce329bc8
7 commits,
2 years ago
49 files
+
1579
−
92
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
49
Search (e.g. *.vue) (Ctrl+P)
app/Exceptions/Handler.php
+
19
−
1
Options
@@ -3,6 +3,10 @@
namespace
App\Exceptions
;
use
Illuminate\Foundation\Exceptions\Handler
as
ExceptionHandler
;
use
Illuminate\Http\JsonResponse
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Response
;
use
Illuminate\Support\Facades\Log
;
use
Throwable
;
class
Handler
extends
ExceptionHandler
@@ -44,7 +48,21 @@ class Handler extends ExceptionHandler
public
function
register
()
{
$this
->
reportable
(
function
(
Throwable
$e
)
{
//
Log
::
error
(
'exception: '
.
$e
->
getTraceAsString
());
});
}
/**
* @param Request $request
* @param Throwable $e
* @return Response|JsonResponse|\Symfony\Component\HttpFoundation\Response
* @throws Throwable
*/
public
function
render
(
$request
,
Throwable
$e
):
Response
|
JsonResponse
|
\Symfony\Component\HttpFoundation\Response
{
if
(
$e
instanceof
SactumAuthenticationException
)
{
return
\response
()
->
json
(
'This process requires to be authenticated'
,
401
);
}
return
parent
::
render
(
$request
,
$e
);
}
}
Loading