Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
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
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
app/controllers/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
...
@@ -9,19 +9,28 @@ class ApplicationController < ActionController::Base
helper_method
:abilities
,
:can?
helper_method
:abilities
,
:can?
rescue_from
Gitlab
::
Gitolite
::
AccessDenied
do
|
exception
|
rescue_from
Gitlab
::
Gitolite
::
AccessDenied
do
|
exception
|
log_exception
(
exception
)
render
"errors/gitolite"
,
layout:
"errors"
,
status:
500
render
"errors/gitolite"
,
layout:
"errors"
,
status:
500
end
end
rescue_from
Encoding
::
CompatibilityError
do
|
exception
|
rescue_from
Encoding
::
CompatibilityError
do
|
exception
|
log_exception
(
exception
)
render
"errors/encoding"
,
layout:
"errors"
,
status:
500
render
"errors/encoding"
,
layout:
"errors"
,
status:
500
end
end
rescue_from
ActiveRecord
::
RecordNotFound
do
|
exception
|
rescue_from
ActiveRecord
::
RecordNotFound
do
|
exception
|
log_exception
(
exception
)
render
"errors/not_found"
,
layout:
"errors"
,
status:
404
render
"errors/not_found"
,
layout:
"errors"
,
status:
404
end
end
protected
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!
def
reject_blocked!
if
current_user
&&
current_user
.
blocked
if
current_user
&&
current_user
.
blocked
sign_out
current_user
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