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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
6 deletions
+23
-6
python/tvm/_ffi/base.py
+23
-6
No files found.
python/tvm/_ffi/base.py
View file @
f71a10c5
...
...
@@ -194,13 +194,30 @@ def _find_error_type(line):
-------
name : str The error name
"""
end_pos
=
line
.
find
(
":"
)
if
end_pos
==
-
1
:
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
err_name
=
line
[:
end_pos
]
if
_valid_error_name
(
err_name
):
return
err_name
return
None
err_name
=
line
[:
end_pos
]
if
_valid_error_name
(
err_name
):
return
err_name
return
None
def
c2pyerror
(
err_msg
):
...
...
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