Conversation
`bref deploy` handled a `no_region_for_environment` error by asking for a region and retrying. Bref Cloud stopped sending that code long ago: a `bref.php` application declares its region in its configuration, and a missing region defaults to us-east-1 on the server. The handler was also only reachable after an AWS account selection, so it could not have run for a team with a single AWS account anyway. Removing it leaves one try/catch per request instead of three nested ones. The 400 body is read once, and every error not meant for the user is rethrown as before. Closes CLOUD-75. Claude-Session: https://claude.ai/code/session_01U5HsfTfcJCtW3rej2d5cp8
`toArray()` throws on a body that is not JSON, for example an HTML error page from the CDN. The exception escaped from inside the catch, so the spinner never stopped and the user read a JSON decoding message instead of the HTTP error. Claude-Session: https://claude.ai/code/session_01U5HsfTfcJCtW3rej2d5cp8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
bref deployhad a handler for theno_region_for_environmenterror code. It asked the user for a region, then sent the deployment again. Bref Cloud does not send that code. Abref.phpapplication declares its region in its configuration, and the server uses us-east-1 when the region is absent (brefphp/cloud#378). The handler was also only reachable after the user selected an AWS account, so a team with one AWS account could not enter it.This pull request removes the handler and
selectAwsRegion(). It also replaces the three nested try/catch blocks with one per request. A newbadRequestBody()method reads the body of a 400 response once. Errors that are not for the user are thrown again, as before.