Skip to content

Commit

Permalink
update sdk error logs
Browse files Browse the repository at this point in the history
  • Loading branch information
callensm committed Jul 5, 2023
1 parent 9571d87 commit 85434df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@coral-xyz/xnft",
"version": "0.2.57",
"version": "0.2.58",
"license": "GPL-3.0-only",
"description": "Node.js client for the xNFT protocol",
"repository": {
Expand Down
6 changes: 6 additions & 0 deletions typescript/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,12 +420,15 @@ export class xNFT {

return filteredXnfts.reduce<XnftAccount[]>((acc, curr, idx) => {
if (xnftBlobs[idx].status === "rejected") {
console.error((xnftBlobs[idx] as PromiseRejectedResult).reason);
console.error(`Failed to fetch the xNFT metadata blob for ${curr.publicKey.toBase58()}`);
return acc;
} else if (mplBlobs[idx].status === "rejected") {
console.error((mplBlobs[idx] as PromiseRejectedResult).reason);
console.error(`Failed to fetch the MPL metadata blob for ${curr.publicKey.toBase58()}`);
return acc;
} else if (tokenAccounts[idx].status === "rejected") {
console.error((tokenAccounts[idx] as PromiseRejectedResult).reason);
console.error(`Failed to fetch the associated token account data for ${curr.publicKey.toBase58()}`);
return acc;
}
Expand Down Expand Up @@ -495,12 +498,15 @@ export class xNFT {

return filteredXnfts.reduce<XnftAccount[]>((acc, curr, idx) => {
if (xnftBlobs[idx].status === "rejected") {
console.error((xnftBlobs[idx] as PromiseRejectedResult).reason);
console.error(`Failed to fetch the xNFT metadata blob for ${curr.publicKey.toBase58()}`);
return acc;
} else if (mplBlobs[idx].status === "rejected") {
console.error((mplBlobs[idx] as PromiseRejectedResult).reason);
console.error(`Failed to fetch the MPL metadata blob for ${curr.publicKey.toBase58()}`);
return acc;
} else if (tokenAccounts[idx].status === "rejected") {
console.error((tokenAccounts[idx] as PromiseRejectedResult).reason);
console.error(`Failed to fetch the associated token account data for ${curr.publicKey.toBase58()}`);
return acc;
}
Expand Down

0 comments on commit 85434df

Please sign in to comment.