Skip to content

Commit

Permalink
Merge pull request #1032 from vikas-cis/error_handle
Browse files Browse the repository at this point in the history
error null handle
  • Loading branch information
kewde authored May 31, 2018
2 parents 82872ab + 23ccc3e commit 7115100
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/app/core/market/api/bid/bid.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ export class BidService {
// bid for item
await this.market.call('bid', ['send', listing.hash, profile.id, addressId]).toPromise()
.catch((error) => {
error = error.error ? error.error.error : error;
if (error.includes('unspent')) {
error = errorType.unspent;
} else if (error.includes('broke')) {
error = errorType.broke;
if (error) {
error = error.error ? error.error.error : error;
if (error.includes('unspent')) {
error = errorType.unspent;
} else if (error.includes('broke')) {
error = errorType.broke;
}
}
throw error;
});
Expand Down

0 comments on commit 7115100

Please sign in to comment.