Closed scott-rc closed 1 month ago
Latest commit: 740dc0ad5e642279140bd6964906b0f012e13726
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
When we format the value of a log field, we split the value by new line, early return if the number of lines is 0, and assert the first line isn't null to make typescript happy:
The issue with this is that
assert(firstLine)
will throw iffirstLine
is an empty string because an empty string is a falsy value 🤦♂️. This can be reproduced by logging a field with only a new line, e.g.Causes this:
This PR fixes that by asserting that the firstLine is not nil, which is what I was originally trying to assert:
The reason this ends up as a
ClientError
is because any errors thrown in theonResponse
callback are passed to theonError
callback which wraps all errors in aClientError
. We might want to change that.../cc @pistachiobaby