File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 1
1
export const ERR_BEST_EFFORT_REQUIRED_READ_ONLY = new Error ( 'Best effort only works for read-only queries' ) ;
2
+ export const READ_ONLY_TXN = new Error ( 'Txn is read-only' ) ;
Original file line number Diff line number Diff line change 1
1
import { QueryTxn , MutateTxn , Mutation , Response } from '../native' ;
2
+ import { READ_ONLY_TXN } from './errors' ;
2
3
3
4
export type TxnOptions = {
4
5
readOnly ?: boolean ;
@@ -52,7 +53,7 @@ export class Txn {
52
53
} ) ;
53
54
} ) ;
54
55
} else {
55
- return Promise . reject ( new Error ( 'txn is read-only' ) ) ;
56
+ return Promise . reject ( READ_ONLY_TXN ) ;
56
57
}
57
58
}
58
59
@@ -70,7 +71,7 @@ export class Txn {
70
71
} ) ;
71
72
} ) ;
72
73
} else {
73
- return Promise . reject ( new Error ( 'txn is read-only' ) ) ;
74
+ return Promise . reject ( READ_ONLY_TXN ) ;
74
75
}
75
76
}
76
77
@@ -88,7 +89,7 @@ export class Txn {
88
89
} ) ;
89
90
} ) ;
90
91
} else {
91
- return Promise . reject ( new Error ( 'txn is read-only' ) ) ;
92
+ return Promise . reject ( READ_ONLY_TXN ) ;
92
93
}
93
94
}
94
95
You can’t perform that action at this time.
0 commit comments