Skip to content

Commit

Permalink
Print suggestion when API returns internal server error (#143)
Browse files Browse the repository at this point in the history
* Print suggestion when API returns internal server error

* Change wording
  • Loading branch information
ofalvai authored Nov 16, 2022
1 parent bd00b3a commit 2049e42
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
)

const changesNotSentForReviewMessage = "Changes cannot be sent for review automatically. Please set the query parameter changesNotSentForReview to true"
const internalServerError = "googleapi: Error 500"

func failf(format string, v ...interface{}) {
log.Errorf(format, v...)
Expand Down Expand Up @@ -190,6 +191,10 @@ func main() {
log.Warnf("Sending the edit to review failed. Please change \"Retry changes without sending to review\" input to true if you wish to send the changes with the changesNotSentForReview flag. Please note that in that case the review has to be manually initiated from Google Play Console UI")
}
}
if strings.Contains(errorString, internalServerError) {
log.Warnf("Google Play API responded with an unknown error")
log.Warnf("Suggestion: create a release manually in Google Play Console because the UI has the capability to present the underlying error in certain cases")
}
failf(errorString)
}

Expand Down

0 comments on commit 2049e42

Please sign in to comment.