Skip to content

Commit

Permalink
try with bind
Browse files Browse the repository at this point in the history
  • Loading branch information
nikmel2803 committed Oct 10, 2024
1 parent 84d20ff commit 2b1ade9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/cli/customTransport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export function customTransport(

const [{ error, result }] = await fn(body)
if (error) {
let loggerFn = logger.error
let loggerFn = logger.error.bind(logger)

if (isHex(error?.data) && error?.data?.length > 10) {
const errorSelector = slice(error?.data, 0, 4)
Expand All @@ -99,13 +99,13 @@ export function customTransport(
FAILED_OP_SELECTOR
].includes(errorSelector as Hex)
) {
loggerFn = logger.info
loggerFn = logger.info.bind(logger)
}
}

loggerFn(
{
error,
err: error,
body
},
"received error response"
Expand Down

0 comments on commit 2b1ade9

Please sign in to comment.