-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix origin of raised EasyBuildError in logged error message #1249
Conversation
@stdweird: please review |
path_parts = frameinfo[1].split(os.path.sep) | ||
relpath = path_parts.pop() | ||
while not (relpath.startswith('easybuild/') or relpath.startswith('vsc/')) and path_parts: | ||
relpath = os.path.join(path_parts.pop() or os.path.sep, relpath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not 100% happy with this, but couldn't find a better way after trying for a while.
Code golf: only retain the interesting part from something like /Users/kehoste/work/easybuild-framework/easybuild/tools/filetools.py
, i.e. the easybuild/tools/filetools.py
part.
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
msg = msg % args | ||
# figure out where error was raised from | ||
# current frame: this constructor, one frame above: location where this EasyBuildError was created/raised | ||
frameinfo = inspect.getouterframes(inspect.currentframe())[1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing remark by @stdweird: this is quite generic, so let's move it to vsc-base instead, and add support to LoggedException to disable this optionally (but have it enabled by default)
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
@boegel looks ok, merge whenever hpcugent/vsc-base#165 is ok |
update: now depends on hpcugent/vsc-base#165
fixes the issue discussed at https://github.com/hpcugent/easybuild-framework/pull/1218/files#r27470965
before:
after: