Re: Internationalized error messages
От | Andrew Evans |
---|---|
Тема | Re: Internationalized error messages |
Дата | |
Msg-id | 20010309114320.C12977@zembu.com обсуждение исходный текст |
Ответ на | Re: Internationalized error messages (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-hackers |
> Peter Eisentraut <peter_e@gmx.net> writes: > > Let's say "type mismatch error", code 2200G acc. to SQL. At one place in > > the source you write > > elog(ERROR, "2200G", "type mismatch in CASE expression (%s vs %s)", ...); Tom Lane <tgl@sss.pgh.pa.us> spake: > I object to writing "2200G" however, because that has no mnemonic value > whatever, and is much too easy to get wrong. How about > > elog(ERROR, ERR_TYPE_MISMATCH, "type mismatch in argument %d of function %s, > expected %s, got %s", ...); > > where ERR_TYPE_MISMATCH is #defined as "2200G" someplace? Or for that > matter #defined as "TYPE_MISMATCH"? Content-free numeric codes are no > fun to use on the client side either... This is one thing I think VMS does well. All error messages are a composite of the subsystem where they originated, the severity of the error, and the actual error itself. Internally this is stored in a 32-bit word. It's been a long time, so I don't recall how many bits they allocated for each component. The human-readable representation looks like "<subsystem>-<severity>-<error>". -- Andrew Evans
В списке pgsql-hackers по дате отправления: