Re: Making error message more user-friendly with spaces in a URI - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: Making error message more user-friendly with spaces in a URI
Date
Msg-id 52329dff-28d7-4bc1-8d1a-88ef896d2c52@oss.nttdata.com
Whole thread Raw
Responses Re: Making error message more user-friendly with spaces in a URI
List pgsql-hackers

On 2024/10/31 10:22, Yushi Ogiwara wrote:
> Hi,
> 
> I made a patch to make the error message more user-friendly when using a URI to connect a database with psql.
> 
> Current Error Message:
> 
> $ psql "postgres://localhost:5432/postgres?application_name=a b"
> psql: error: trailing data found: "a b"
> 
> Currently, if spaces exist in the URI, psql displays this generic error message.
> 
> New Error Message (with patch):
> 
> psql: error: found unexpected spaces: “a b“. Did you forget to percent-encode spaces?
> 
> This revised message is clearer and more concise, guiding users to check for encoding issues.

I agree the error message could be improved.

The phrasing "Did you forget" feels a bit indirect to me.
How about using something clearer and more direct instead?

-----------
psql: error: unexpected spaces found "a b", use percent-encoded spaces instead
-----------

Regards,

-- 
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION




pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: Making error message more user-friendly with spaces in a URI
Next
From: Peter Eisentraut
Date:
Subject: Re: Virtual generated columns