Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
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
Hsin-Yu Chien
edx-platform-release
Commits
05c22c49
Commit
05c22c49
authored
12 years ago
by
Victor Shnayder
Browse files
Options
Downloads
Patches
Plain Diff
Prettier error display
* Log formatted traceback string instead of exc_info tuple itself * display as a list
parent
32253510
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
common/lib/xmodule/xmodule/errortracker.py
+7
-6
7 additions, 6 deletions
common/lib/xmodule/xmodule/errortracker.py
lms/templates/courseware.html
+7
-1
7 additions, 1 deletion
lms/templates/courseware.html
with
14 additions
and
7 deletions
common/lib/xmodule/xmodule/errortracker.py
+
7
−
6
View file @
05c22c49
import
logging
import
sys
import
traceback
from
collections
import
namedtuple
...
...
@@ -14,21 +15,21 @@ def in_exception_handler():
def
make_error_tracker
():
'''
Return an ErrorLog (named tuple), with fields (tracker, errors), where
the logger appends a tuple (message, exc
_info=None)
to the errors on every call
.
the logger appends a tuple (message, exc
eption_str) to the errors on every
call. exception_str is in the format returned by traceback.format_exception
.
error_list is a simple list. If the caller m
esses with
it, info
error_list is a simple list. If the caller m
odifies
it, info
will be lost.
'''
errors
=
[]
def
error_tracker
(
msg
):
'''
Log errors
'''
exc_
info
=
None
exc_
str
=
''
if
in_exception_handler
():
exc_
info
=
sys
.
exc_info
()
exc_
str
=
''
.
join
(
traceback
.
format_exception
(
*
sys
.
exc_info
()
))
errors
.
append
((
msg
,
exc_
info
))
errors
.
append
((
msg
,
exc_
str
))
return
ErrorLog
(
error_tracker
,
errors
)
...
...
This diff is collapsed.
Click to expand it.
lms/templates/courseware.html
+
7
−
1
View file @
05c22c49
...
...
@@ -51,7 +51,13 @@
% if course_errors is not UNDEFINED:
<h2>
Course errors
</h2>
<div
id=
"course-errors"
>
${course_errors}
<ul>
% for (msg, err) in course_errors:
<li>
${msg}
<ul><li><pre>
${err}
</pre></li></ul>
</li>
% endfor
</ul>
</div>
% endif
</section>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment