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

refactor error handling #48

Merged
merged 1 commit into from
Jul 27, 2019

Conversation

brendanjryan
Copy link
Collaborator

In its current form - a lot of the test code treats messages (warn and fail) produced by the rego check process as "first class" go errors. This results in some confusion and tangling of dependancies when having to guard against and handle other types of errors, which could come from failing to open a file or downstream errors thrown by the rego compiler itself.

This patch proposes refactoring the return type of many internal methods to be of (checkResult, error) to make this behavior more explicit. I'm very open to different names or another approach if other maintainers think that would be best!

@garethr garethr added the enhancement New feature or request label Jul 27, 2019
@garethr
Copy link
Contributor

garethr commented Jul 27, 2019

I think this is good, thanks. I'm happy with the naming at least, and we can change the name in a follow up if folks have string feelings.

@garethr garethr merged commit 5bd01a6 into open-policy-agent:master Jul 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants