graphile / graphile.github.io

PostGraphile (PostGraphQL) and Graphile-Build website - contributions very welcome!
https://www.graphile.org/
25 stars 128 forks source link

docs(debugging): correct error code extension #324

Closed dargmuesli closed 2 years ago

dargmuesli commented 2 years ago

There does not seem to be a errcode (anymore?), but only a code.

The comma separated list below shows code instead of errcode too.

benjie commented 2 years ago

pg places 'errcode' on the 'code' property, so we translate it automatically:

https://github.com/graphile/postgraphile/blob/601a1086a2c10ebae4747364e199f2517d653861/src/postgraphile/extendedFormatError.ts#L20-L24

benjie commented 2 years ago

(And we use errcode since that's what Postgres uses: https://www.postgresql.org/docs/current/plpgsql-errors-and-messages.html )

I'm going to close this as the current behaviour is intentional; however if you find that using --errcode does not result in the error codes being made available, please let me know a reproduction.

benjie commented 2 years ago

The comma list having code in it is certainly interesting... I wonder why that was. Maybe that should have been errcode all along.

dargmuesli commented 2 years ago

Ok, so as I understand and tested it, errcode is intended to be used, but code works too.