Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeray Santana Hualde
syncEnrollments
Commits
fa0e6c8d
Commit
fa0e6c8d
authored
Jul 06, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Trimming comment bloat from Error class.
parent
014c2ebf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
22 deletions
+2
-22
error.php
system/error.php
+2
-22
No files found.
system/error.php
View file @
fa0e6c8d
...
...
@@ -31,24 +31,16 @@ class Error {
*/
public
static
function
handle
(
$e
)
{
// -----------------------------------------------------
// Clean the output buffer. We don't want any rendered
// views or text to be sent to the browser.
// -----------------------------------------------------
// Clean the output buffer. We don't want any rendered views or text sent to the browser.
if
(
ob_get_level
()
>
0
)
{
ob_clean
();
}
// -----------------------------------------------------
// Get the error severity in human readable format.
// -----------------------------------------------------
$severity
=
(
array_key_exists
(
$e
->
getCode
(),
static
::
$levels
))
?
static
::
$levels
[
$e
->
getCode
()]
:
$e
->
getCode
();
// -----------------------------------------------------
// Get the error file. Views require special handling
// since view errors occur within eval'd code.
// -----------------------------------------------------
// Get the error file. Views require special handling since view errors occur in eval'd code.
if
(
strpos
(
$e
->
getFile
(),
'view.php'
)
!==
false
and
strpos
(
$e
->
getFile
(),
"eval()'d code"
)
!==
false
)
{
$file
=
APP_PATH
.
'views/'
.
View
::
$last
.
EXT
;
...
...
@@ -65,14 +57,6 @@ class Error {
Log
::
error
(
$message
.
' in '
.
$e
->
getFile
()
.
' on line '
.
$e
->
getLine
());
}
// -----------------------------------------------------
// Detailed error view contains the file name and stack
// trace of the error. It is not wise to have details
// enabled in a production environment.
//
// The generic error view (error/500) only has a simple,
// generic error message suitable for production.
// -----------------------------------------------------
if
(
Config
::
get
(
'error.detail'
))
{
$view
=
View
::
make
(
'exception'
)
...
...
@@ -109,15 +93,11 @@ class Error {
array_unshift
(
$file
,
''
);
// -----------------------------------------------------
// Calculate the starting position of the file context.
// -----------------------------------------------------
$start
=
$line
-
$padding
;
$start
=
(
$start
<
0
)
?
0
:
$start
;
// -----------------------------------------------------
// Calculate the context length.
// -----------------------------------------------------
$length
=
(
$line
-
$start
)
+
$padding
+
1
;
$length
=
((
$start
+
$length
)
>
count
(
$file
)
-
1
)
?
null
:
$length
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment