Skip to content
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

feat: show the call stack and line numbers when an error occurs while running starlark functions like transform #968

Merged

Conversation

HarikrishnanBalagopal
Copy link
Contributor

@HarikrishnanBalagopal HarikrishnanBalagopal commented Feb 17, 2023

Example bug in a Starlark transformer:

                    if 'HostPath' in v:
                        path = v['HostPath']['Path']

and error output shows the exact line number and the starlark file name:

ERRO[0000] failed to transform artifacts using the transformer named 'ConfigMapGen' . Error: failed to call the starlark function '<function transform>' . The call stack is:
Traceback (most recent call last):
  /var/folders/dt/y3srs7vs6pz9bqwrbjwt38pc0000gp/T/move2kube313903856/m2kassets/custom/cfg-map-generator/configmapgen.star:49:45: in transform
Error: unhandled index operation NoneType[string]
Error: unhandled index operation NoneType[string] 

… running starlark functions like transform

Signed-off-by: Harikrishnan Balagopal <harikrishmenon@gmail.com>
@github-actions
Copy link

Thanks for making a pull request! 😃
One of the maintainers will review and advise on the next steps.

@github-actions github-actions bot added the feat label Feb 17, 2023
@github-actions
Copy link

Thanks for making a pull request! 😃
One of the maintainers will review and advise on the next steps.

@ashokponkumar ashokponkumar merged commit 70c5fb8 into konveyor:main Feb 17, 2023
@HarikrishnanBalagopal HarikrishnanBalagopal deleted the feat/starlarklinenumbers branch February 17, 2023 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants