Skip to content

Commit ca4e02e

Browse files
committed
fix: improved error handling
1 parent 168f6c4 commit ca4e02e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,14 @@ class CoCreateMetrics {
7979
if (this.wsManager.organizations.has(organization_id)) {
8080
if (organization.balance <= 0) {
8181
this.wsManager.organizations.get(organization_id).status = false
82-
} else
82+
this.wsManager.organizations.get(organization_id).organizationBalance = false
83+
this.wsManager.organizations.get(organization_id).error = 'Your balance has fallen bellow 0'
84+
85+
} else {
8386
this.wsManager.organizations.get(organization_id).status = true
87+
this.wsManager.organizations.get(organization_id).organizationBalance = true
88+
this.wsManager.organizations.get(organization_id).error = ''
89+
}
8490
}
8591

8692
let timeStamp = new Date();

0 commit comments

Comments
 (0)