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

Improve error messaging when types are not exported #1456

Closed
wesbillman opened this issue May 9, 2024 · 1 comment
Closed

Improve error messaging when types are not exported #1456

wesbillman opened this issue May 9, 2024 · 1 comment
Assignees
Labels
good first issue Good for newcomers

Comments

@wesbillman
Copy link
Member

When a user tries to ftl.call a verb that is not exported, it isn't obvious to the user what they need to do to resolve the error. Should we add a message like

Currently the message(s) are:

call first argument must be a function but is an unresolved reference to time.Internal
call first argument must be a function in an ftl module

Should we update to something like:

call first argument must be a function but is an unresolved reference to time.Internalftl, does is need to be exported?
call first argument must be a function in an ftl module, does it need to be exported?

Screenshot 2024-05-09 at 2 43 43 PM

//ftl:verb
func Internal(ctx context.Context, req TimeRequest) (TimeResponse, error) {
	return TimeResponse{Time: time.Now()}, nil
}
@github-actions github-actions bot added the triage Issue needs triaging label May 9, 2024
@alecthomas alecthomas mentioned this issue May 9, 2024
@deniseli deniseli added good first issue Good for newcomers and removed triage Issue needs triaging labels May 9, 2024
jonathanj-square added a commit that referenced this issue May 17, 2024
Uses the selector expression to determine whether a non-exported entity
exists and updates the message accordingly.
@jonathanj-square
Copy link
Contributor

covered by https://github.com/jonathanj-square

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants