Skip to content
This repository was archived by the owner on Sep 5, 2025. It is now read-only.

Commit 192e20f

Browse files
committed
Build after merge
1 parent 6581ef2 commit 192e20f

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

lib/errors.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export declare const ERR_NO_CLIENTS: Error;
22
export declare const ERR_FINISHED: Error;
33
export declare const ERR_ABORTED: Error;
4+
export declare const ERR_BEST_EFFORT_REQUIRED_READ_ONLY: Error;
45
export declare class CustomError extends Error {
56
readonly name: string;
67
constructor(message?: string);

lib/errors.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
1616
exports.ERR_NO_CLIENTS = new Error("No clients provided in DgraphClient constructor");
1717
exports.ERR_FINISHED = new Error("Transaction has already been committed or discarded");
1818
exports.ERR_ABORTED = new Error("Transaction has been aborted. Please retry");
19+
exports.ERR_BEST_EFFORT_REQUIRED_READ_ONLY = new Error("Best effort only works for read-only queries");
1920
var CustomError = (function (_super) {
2021
__extends(CustomError, _super);
2122
function CustomError(message) {

lib/txn.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ var Txn = (function () {
4444
this.mutated = false;
4545
this.dc = dc;
4646
if (options && options.bestEffort && !options.readOnly) {
47-
this.dc.debug('Best effort only works with read-only queries.');
48-
throw errors_1.ERR_ABORTED;
47+
this.dc.debug('Client attempted to query using best-effort without setting the transaction to read-only');
48+
throw errors_1.ERR_BEST_EFFORT_REQUIRED_READ_ONLY;
4949
}
5050
this.ctx = {
5151
start_ts: 0,
5252
keys: [],
5353
preds: [],
5454
readOnly: options && options.readOnly,
55-
bestEffort: options && options.bestEffort
55+
bestEffort: options && options.bestEffort,
5656
};
5757
}
5858
Txn.prototype.query = function (q, options) {

0 commit comments

Comments
 (0)