Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tic
Overview
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
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
wenyuanbo
tic
Commits
f71a10c5
Commit
f71a10c5
authored
Jan 27, 2020
by
Jon Soifer
Committed by
Tianqi Chen
Jan 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
properly extract error type from windows error message (#4780)
Co-authored-by: Jon Soifer <jonso@microsoft.com>
parent
00ec7f9c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
python/tvm/_ffi/base.py
+17
-0
No files found.
python/tvm/_ffi/base.py
View file @
f71a10c5
...
...
@@ -194,6 +194,23 @@ def _find_error_type(line):
-------
name : str The error name
"""
if
sys
.
platform
==
"win32"
:
# Stack traces aren't logged on Windows due to a DMLC limitation,
# so we should try to get the underlying error another way.
# DMLC formats errors "[timestamp] file:line: ErrorMessage"
# ErrorMessage is usually formatted "ErrorType: message"
# We can try to extract the error type using the final ":"
end_pos
=
line
.
rfind
(
":"
)
if
end_pos
==
-
1
:
return
None
start_pos
=
line
.
rfind
(
":"
,
0
,
end_pos
)
if
start_pos
==
-
1
:
return
None
err_name
=
line
[
start_pos
+
1
:
end_pos
]
.
strip
()
if
_valid_error_name
(
err_name
):
return
err_name
return
None
else
:
end_pos
=
line
.
find
(
":"
)
if
end_pos
==
-
1
:
return
None
...
...
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