Skip to content

Commit 310b708

Browse files
authored
Merge pull request #15 from tonlabs/0.3.4-rc
Add checking query
2 parents 7e0c88a + fed407a commit 310b708

File tree

3 files changed

+25
-5
lines changed

3 files changed

+25
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [0.3.4] – 2022-11-17
6+
7+
- Improved error handling in case of network errors
8+
59
## [0.3.3] – 2022-11-14
610

711
### Fix

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@eversdk/appkit",
3-
"version": "0.3.3",
3+
"version": "0.3.4",
44
"description": "FreeTON SDK: Application Kit",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/account.ts

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -561,11 +561,27 @@ export class Account {
561561
return boc;
562562
}
563563
throw AccountError.missingBOC();
564-
} catch (error: any) {
565-
if (error.code === 603) {
566-
throw AccountError.missingBOC();
564+
} catch (waitForError: any) {
565+
if (waitForError.code === 603) {
566+
try {
567+
// Checking query
568+
const { result } = await net.query_collection({
569+
collection: "accounts",
570+
filter: {
571+
id: { eq: this.address },
572+
},
573+
result: "id",
574+
});
575+
if (result.length === 0) {
576+
throw AccountError.missingBOC();
577+
} else {
578+
throw waitForError;
579+
}
580+
} catch (checkQueryError: any) {
581+
throw checkQueryError;
582+
}
567583
}
568-
throw error
584+
throw waitForError;
569585
}
570586
}
571587

0 commit comments

Comments
 (0)