Error not serializable due to circular references
Describe the bug
Error thrown by calling new SSMClient({}).send(new GetParameterCommand({Name: name})) cannot be serialized by the pino logger due to circular reference.
"err":"[unable to serialize, circular reference is too complex to analyze]"
Your environment
SDK version number
@aws-sdk/[email protected]
Is the issue in the browser/Node.js/ReactNative?
Node.js
Details of the browser/Node.js/ReactNative version
v16.14.0
Steps to reproduce
Do a GetParameterCommand for a parameter name that does not exist:
new SSMClient({}).send(new GetParameterCommand({Name: name}))
Observed behavior
Pino log:
"err":"[unable to serialize, circular reference is too complex to analyze]"
Expected behavior
Pino log:
"err":{"name":"...","message":"...",...}
Screenshots
Additional context
Hey @stefee thanks for opening this issue, from the SDK I do get ParameterNotFound error. https://github.com/pinojs/pino maybe be the right place for this issue.
This could be fixed by removing circular references.