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

ref: Provide better missing project id error message #1634

Merged
merged 1 commit into from
Nov 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/utils/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ var (
CustomRolesPath = filepath.Join(SupabaseDirPath, "roles.sql")

ErrNotLinked = errors.New("Cannot find project ref. Have you run " + Aqua("supabase link") + "?")
ErrInvalidRef = errors.New("Invalid project ref format. Must be like `abcdefghijklmnopqrst`.")
ErrInvalidRef = errors.New("Missing or invalid project ID. Use " + Aqua("--project-ref") + "or" + Aqua("SUPABASE_PROJECT_ID") + "env variable to set it. Project ID can be found on project settings page.")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's better to create a new error for missing ref. We can update AssertProjectRefIsValid method to check for empty string.

ErrNotRunning = errors.New(Aqua("supabase start") + " is not running.")
)

Expand Down