-
Notifications
You must be signed in to change notification settings - Fork 246
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
Add additional error context onto schema errors #481
Conversation
5e3b2eb
to
0017068
Compare
@@ -130,18 +130,18 @@ func TestEditCheck(t *testing.T) { | |||
|
|||
definition resource { | |||
relation writer: user | |||
permission writer = writer | |||
permission writer = writer |
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.
nit: spacing
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.
Was actually done on purpose to give a different column index on the error message, but I adjusted to make less odd looking as bit
feb47d1
to
3e22b63
Compare
pkg/commonerrors/common.go
Outdated
} | ||
|
||
// NewErrorWithSource creates and returns a new ErrorWithSource. | ||
func NewErrorWithSource(err error, sourceCodeString string, lineNumber uint64, columnPosition uint64) *ErrorWithSource { |
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.
Note in method doc or change line number and column position param names to include that they are 1-based to make it clear to the caller? All other line/col fields are named and/or documented so might as well for this as well.
3e22b63
to
bedfc14
Compare
Updated |
bedfc14
to
849546d
Compare
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.
LGTM
Adds source position information onto the compiled namespace definitions and then uses it in the type system to return errors with more context
Fixes #447 and Fixes AUTHZ-422