BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
be4138af
Commit
be4138af
authored
Nov 06, 2012
by
Riyad Preukschas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Log caught exceptions
parent
96b2959f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
application_controller.rb
app/controllers/application_controller.rb
+9
-0
No files found.
app/controllers/application_controller.rb
View file @
be4138af
...
...
@@ -9,19 +9,28 @@ class ApplicationController < ActionController::Base
helper_method
:abilities
,
:can?
rescue_from
Gitlab
::
Gitolite
::
AccessDenied
do
|
exception
|
log_exception
(
exception
)
render
"errors/gitolite"
,
layout:
"errors"
,
status:
500
end
rescue_from
Encoding
::
CompatibilityError
do
|
exception
|
log_exception
(
exception
)
render
"errors/encoding"
,
layout:
"errors"
,
status:
500
end
rescue_from
ActiveRecord
::
RecordNotFound
do
|
exception
|
log_exception
(
exception
)
render
"errors/not_found"
,
layout:
"errors"
,
status:
404
end
protected
def
log_exception
(
exception
)
application_trace
=
ActionDispatch
::
ExceptionWrapper
.
new
(
env
,
exception
).
application_trace
application_trace
.
map!
{
|
t
|
"
#{
t
}
\n
"
}
logger
.
error
"
\n
#{
exception
.
class
.
name
}
(
#{
exception
.
message
}
):
\n
#{
application_trace
.
join
}
"
end
def
reject_blocked!
if
current_user
&&
current_user
.
blocked
sign_out
current_user
...
...
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