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

[Circle CI] set badge text as message when invalid #816

Closed
wants to merge 3 commits into from

Conversation

RedSparr0w
Copy link
Member

Give a general idea of why the badge is not displaying as expected.
only when status not available and message is available otherwise defaults to "invalid"

example invalid response:

{
  "message" : "Permission denied"
}

example badges:



-vs-

break;
}
} catch(e) {
badgeData.text[1] = data.message;
Copy link
Member

Choose a reason for hiding this comment

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

Can we simply check whether 'data.message' is present, and assume it is an error?

Copy link
Member Author

@RedSparr0w RedSparr0w Oct 24, 2016

Choose a reason for hiding this comment

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

its more for if there is an error and data.message is present then show the user the message so they might be able to work out for themselves how to fix the image url.

In the following cases:

Permission denied:

  • the user has supplied a key with insufficient/incorrect privileges.

Project not found:

  • the project does not exist on Circle CI (maybe mistyped)
  • no key was supplied when it was necessary to do so (private)

There may be more, but i haven't seen any others yet.

If you prefer to keep it the way it is now i understand though as this could also lead to more confusion than just showing a standard message.

edit:
if you supply an invalid branch (but valid project) the response is: [ ] which would return
edit edit: got confused, yeah that would probably work just as well

Updated

@RedSparr0w
Copy link
Member Author

Updated to check if data.message !== undefined

@espadrine
Copy link
Member

espadrine commented Oct 25, 2016

Thanks! Merged by 3edd0df.

@espadrine espadrine closed this Oct 25, 2016
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.

2 participants