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

[API-677] Return correct error in ConfigQuery #927

Merged
merged 2 commits into from
May 4, 2023
Merged

[API-677] Return correct error in ConfigQuery #927

merged 2 commits into from
May 4, 2023

Conversation

professor-l
Copy link
Contributor

@professor-l professor-l commented May 3, 2023

Checklist

=========

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have checked for similar issues and haven't found anything relevant.
  • This is not a security issue (which should be reported here: https://circleci.com/security/)
  • I have read Contribution Guidelines.

Internal Checklist

  • I am requesting a review from my own team as well as the owning team
  • I have a plan in place for the monitoring of the changes that I am making (this can include new monitors, logs to be aware of, etc...)

Changes

=======

  • Log originalErr when originalErr is non-nil

Rationale

=========

Attempting to validate a config while passing an invalid token fails with the following error:

$ circleci --token "invalid-token" config validate .circleci/config.yml -v
...
Error: config compilation request returned an error: %!w(<nil>)

The behavior would previously check if an error existed, but return a different one. After fixing that, the error prints correctly:

Error: config compilation request returned an error: invalid character 'I' looking for beginning of value

It's worth noting that the PR template explicitly instructs branching off of main, so if this should be rebased to develop instead then the template may also need updating.

zbenhadi and others added 2 commits May 2, 2023 11:01
* Add warning on some CLI commands that orbs cannot be deleted once they are created

* Add org-slug and org-id flags to orb validate & process commands (#922)

---------

Co-authored-by: rlegan <[email protected]>
Co-authored-by: JulesFaucherre <[email protected]>
Co-authored-by: Renaud <[email protected]>
During some testing, it was discovered that attempting to validate a
config while passing an invalid token fails with the following error:

```
$ circleci --token "invalid-token" config validate .circleci/config.yml -v
...
Error: config compilation request returned an error: %!w(<nil>)
```

The behavior would previously check if an error existed, but return a
different one. After fixing that, the error prints correctly.
@professor-l professor-l requested review from a team as code owners May 3, 2023 20:14
Copy link

@nbialostosky nbialostosky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving commit e255781 as it should address the error we were seeing before. We tested this locally too on a call.

Copy link
Contributor

@JulesFaucherre JulesFaucherre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing that!

@JulesFaucherre JulesFaucherre merged commit 7afdc21 into CircleCI-Public:develop May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants