File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -1345,6 +1345,9 @@ const mainStore = {
1345
1345
. then ( response => response . json ( ) )
1346
1346
. then ( json => {
1347
1347
if ( json ) {
1348
+ if ( json . error ) {
1349
+ reject ( new Error ( json . message [ 0 ] ) )
1350
+ }
1348
1351
if ( json . data . length > 0 ) {
1349
1352
const payload = json . data . map ( x => {
1350
1353
return {
@@ -1362,7 +1365,8 @@ const mainStore = {
1362
1365
}
1363
1366
1364
1367
resolve ( json . data )
1365
- } else {
1368
+ }
1369
+ else {
1366
1370
resolve ( [ ] )
1367
1371
commit ( 'setDIDList' , [ ] )
1368
1372
}
@@ -1415,13 +1419,12 @@ const mainStore = {
1415
1419
. then ( json => {
1416
1420
1417
1421
if ( json ) {
1418
-
1419
-
1420
-
1422
+ if ( json . error ) {
1423
+ reject ( new Error ( json . message [ 0 ] ) )
1424
+ }
1421
1425
resolve ( json . didDocument )
1422
-
1423
1426
} else {
1424
- reject ( new Error ( 'Could not resovle ' ) )
1427
+ reject ( new Error ( 'Could not resolve ' ) )
1425
1428
}
1426
1429
1427
1430
} ) . catch ( e => {
@@ -1466,6 +1469,9 @@ const mainStore = {
1466
1469
. then ( response => response . json ( ) )
1467
1470
. then ( json => {
1468
1471
if ( json ) {
1472
+ if ( json . error ) {
1473
+ reject ( new Error ( json . message [ 0 ] ) )
1474
+ }
1469
1475
const data = {
1470
1476
did : payload ,
1471
1477
didDocument : json . didDocument ,
@@ -1507,6 +1513,9 @@ const mainStore = {
1507
1513
} )
1508
1514
. then ( response => response . json ( ) )
1509
1515
. then ( async json => {
1516
+ if ( json . error ) {
1517
+ reject ( new Error ( json . message [ 0 ] ) )
1518
+ }
1510
1519
if ( json && json . did ) {
1511
1520
commit ( 'insertDIDList' , {
1512
1521
did : json . did ,
You can’t perform that action at this time.
0 commit comments