github-community-projects / private-mirrors

A GitHub App that allows you to contribute upstream using private mirrors of public projects
MIT License
119 stars 12 forks source link

feat: add error messages to error flashes #179

Closed sutterj closed 2 months ago

sutterj commented 2 months ago

Pull Request

Proposed Changes

Readiness Checklist

Author/Contributor

Reviewer

sutterj commented 2 months ago

Currently there is some handling in the create procedure to make a "pretty" message if one already exists:

Image

This is the only error that has this, so is it worthwhile to do this for the other procedures or is that too specific/tedious because of the number of possible errors:

Image

zkoppert commented 2 months ago

Currently there is some handling in the create procedure to make a "pretty" message if one already exists:

Image

This is the only error that has this, so is it worthwhile to do this for the other procedures or is that too specific/tedious because of the number of possible errors:

Image

@ahpook thoughts?

ahpook commented 2 months ago

Hmmm. How many potential other messages are we looking at? The json barf is pretty ugly ...

Is the format predictable enough to extract the message field and pretty-print that with a generic "Failed to create mirror. Error was: " banner?

sutterj commented 2 months ago

I'm not really sure how many, but I would guess that the name conflict one is probably the most common and that one is already covered. I would imagine that the API is consistent and returns a message field though and that would be easy to add to the banner by itself.