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

Assembly Error Message #3082

Closed
barnjamin opened this issue Oct 17, 2021 · 2 comments · Fixed by #3190
Closed

Assembly Error Message #3082

barnjamin opened this issue Oct 17, 2021 · 2 comments · Fixed by #3190
Assignees
Labels
new-feature-request Feature request that needs triage Team Scytale unplanned

Comments

@barnjamin
Copy link
Contributor

Problem

When using the API to compile a teal contract, if there is a syntax error or something else the error returned is a generic "%d error(s)" with no hints on what it might be.

The assembler does have some list of the errors but summarizes them with a count here:
https://github.com/algorand/go-algorand/blob/master/data/transactions/logic/assembler.go#L1676-L1682

Is this done for a specific reason or could we return some string with all the error messages or at least the first N?

@barnjamin barnjamin added the new-feature-request Feature request that needs triage label Oct 17, 2021
@hernandp
Copy link

I asked a similar feature, but using integers as error codes.
#3013

@algochoi
Copy link
Contributor

algochoi commented Nov 3, 2021

I think the discrepancy is because in the goal clerk command, ReportProblems() is explicitly called and returns the error array to stderr.

However, it seems like we do not do this for the /teal/compile/ API endpoint yet. We call assemble(), which only returns the number of errors in a program. If we could also report the error array here, I think it would save a lot of devs trouble 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature-request Feature request that needs triage Team Scytale unplanned
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants