Re: errmsg("... because ...")

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: errmsg("... because ...")
Дата
Msg-id 200412112037.53401.peter_e@gmx.net
обсуждение исходный текст
Ответ на errmsg("... because ...")  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
Список pgsql-hackers
Alvaro Herrera wrote:
> errmsg("cannot assign to field \"%s\" of column \"%s\" because its
> type %s is not a composite type")
>
> What do you think of changing those to use errdetail in addition to
> errmsg?  So this particular example would become something like
>
> errmsg("cannot assign to field \"%s\" of column \"%s\"),
> errdetail("Its type %s is not a composite type.")

The style guidelines state that an error message should include the 
reason for the error.  That is fully intentional, and I would consider 
the above to be a step backward.

In fact, every use of %m would fall into your bunch as well.  We only 
write "could not open file: %m" instead of "could not open file because 
%m" for grammatical reasons.  I don't think splitting out the %m would 
be an improvement.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Andrew Dunstan"
Дата:
Сообщение: Re: regression script/makefile exit failure
Следующее
От: Pucky Loucks
Дата:
Сообщение: port report: OSX 10.3