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: ParseComment error to contain the comment #1777

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ func (operation *Operation) ParseParamComment(commentLine string, astFile *ast.F
param.Schema = schema
}
default:
return fmt.Errorf("%s is not supported paramType", paramType)
return fmt.Errorf("not supported paramType: %s", paramType)
}

err := operation.parseParamAttribute(commentLine, objectType, refType, paramType, &param)
Expand Down
2 changes: 1 addition & 1 deletion parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,7 @@ DeclsLoop:
for _, comment := range astDeclaration.Doc.List {
err := operation.ParseComment(comment.Text, fileInfo.File)
if err != nil {
return fmt.Errorf("ParseComment error in file %s :%+v", fileInfo.Path, err)
return fmt.Errorf("ParseComment error in file %s for comment: '%s': %+v", fileInfo.Path, comment.Text, err)
}
if operation.State != "" && operation.State != parser.HostState {
continue DeclsLoop
Expand Down
Loading