Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gargantext
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
humanities
gargantext
Commits
af65fed3
Commit
af65fed3
authored
Apr 19, 2015
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEAT] To all developers, please use this function PrintException().
parent
956ddde4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
utils.py
admin/utils.py
+12
-1
No files found.
admin/utils.py
View file @
af65fed3
import
os
import
os
,
sys
import
linecache
from
gargantext_web.settings
import
MEDIA_ROOT
def
ensure_dir
(
user
):
...
...
@@ -9,3 +11,12 @@ def ensure_dir(user):
os
.
makedirs
(
dirpath
)
def
PrintException
():
exc_type
,
exc_obj
,
tb
=
sys
.
exc_info
()
f
=
tb
.
tb_frame
lineno
=
tb
.
tb_lineno
filename
=
f
.
f_code
.
co_filename
linecache
.
checkcache
(
filename
)
line
=
linecache
.
getline
(
filename
,
lineno
,
f
.
f_globals
)
print
(
'EXCEPTION IN ({}, LINE {} "{}"): {}'
.
format
(
filename
,
lineno
,
line
.
strip
(),
exc_obj
))
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