Skip to content

Commit dffaeb8

Browse files
authored
Update example code since upgrade to pino 9.9.0 (#791)
1 parent 939d072 commit dffaeb8

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

examples/transfer-lamports/src/example.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,8 @@ const transactionMessage = pipe(
133133
* to create a transfer instruction for the system program.
134134
*/
135135
(log.info(
136-
'[step 1] Creating an instruction to transfer Lamports from',
136+
'[step 1] Creating an instruction to transfer Lamports from %s to %s',
137137
SOURCE_ACCOUNT_SIGNER.address,
138-
'to',
139138
DESTINATION_ACCOUNT_ADDRESS,
140139
),
141140
getTransferSolInstruction({
@@ -195,7 +194,11 @@ try {
195194
const errorDetailMessage = isSystemError(e.cause, transactionMessage)
196195
? getSystemErrorMessage(e.cause.context.code)
197196
: e.cause?.message;
198-
log.error(preflightErrorContext, '%s: %s', preflightErrorMessage, errorDetailMessage);
197+
if (errorDetailMessage !== undefined) {
198+
log.error('%O %s: %s', preflightErrorContext, preflightErrorMessage, errorDetailMessage);
199+
} else {
200+
log.error('%O %s', preflightErrorContext, preflightErrorMessage);
201+
}
199202
} else {
200203
throw e;
201204
}

0 commit comments

Comments
 (0)