3 ms·
>it returns an error with string representation: "open cred.json: no such file or directory". This comes straight from the std lib as it is, a great error. It’
by vl 2y ago
>it returns an error with string representation: "open cred.json: no such file or directory". This comes straight from the std lib as it is, a great error.
It’s a terrible error. It’s not structured, so you can’t aggregate it effectively in logs, on top of that it leaks potential secret, so you can’t return it from RPC handler.
- rollulus 2y agoThe string representation is obviously not structured, because it's a string representation and strings are scalars. The typed representation is structured, which you can put into your structured logs as you'd like, omitting sensitive information where needed.
- zaptheimpaler 2y agoThe "typed" representation is an `error` type that a million other methods use with a single method that returns the string: type error interface { Error() string } It's the same unstructured goslop.
- philosopher1234 2y agoThis error is backed by a strict with error codes and so on.