Skip to content

fix(db export): explain unsupported Fly exports#1038

Open
ada-powerful wants to merge 1 commit into
tursodatabase:mainfrom
ada-powerful:fix-export-fly-error-message
Open

fix(db export): explain unsupported Fly exports#1038
ada-powerful wants to merge 1 commit into
tursodatabase:mainfrom
ada-powerful:fix-export-fly-error-message

Conversation

@ada-powerful
Copy link
Copy Markdown

Fixes #981.

Problem

When turso db export is run against a database whose export endpoints are unavailable, the CLI currently bubbles up a raw HTTP error like:

failed to export database: response failed with status 404 Not Found

For Fly-hosted databases, that does not explain what the user can do next.

Fix

Handle 404 responses in the export path with a specific message explaining that database export is unavailable for that database and pointing users to turso db shell <database> .dump as the SQL dump fallback. Other export errors still use the existing response parser.

Added a regression test for the /info 404 path so the raw response failed with status 404 Not Found message does not come back.

Tests

docker run --rm -v "$PWD":/src -w /src golang:1.25 gofmt -w internal/turso/tursoServer.go internal/turso/tursoServer_test.go
docker run --rm -v "$PWD":/src -w /src golang:1.25 go test ./internal/turso -run "TestExportReportsUnsupportedDatabaseForNotFound|TestUploadFileMultipart_ContentLengthHeader"
docker run --rm -v "$PWD":/src -w /src golang:1.25 go test ./internal/turso

Disclosure

This PR was prepared by an AI agent under direct human review. Happy to adjust the wording if there is a preferred export fallback message.

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.

Improve export error message on Fly

1 participant