Skip to content

Commit

Permalink
THRIFT-5848: Expose InputBufferUnderrunError in nodejs client
Browse files Browse the repository at this point in the history
When implementing a custom `Connection`, it is very useful to be able to respond to `InputBufferUnderrunError` to roll back the position of the transport. This is now exposed through the root module, so that custom connections can use this.
  • Loading branch information
cameron-martin authored and Jens-G committed Feb 8, 2025
1 parent 42204e7 commit 7fe4bf5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/nodejs/lib/thrift/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,5 @@ exports.Protocol = require('./json_protocol');
exports.TJSONProtocol = require('./json_protocol');
exports.TBinaryProtocol = require('./binary_protocol');
exports.TCompactProtocol = require('./compact_protocol');

exports.InputBufferUnderrunError = require('./input_buffer_underrun_error');
2 changes: 2 additions & 0 deletions lib/nodejs/lib/thrift/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,5 @@ exports.TJSONProtocol = require('./json_protocol');
exports.TBinaryProtocol = require('./binary_protocol');
exports.TCompactProtocol = require('./compact_protocol');
exports.THeaderProtocol = require('./header_protocol');

exports.InputBufferUnderrunError = require('./input_buffer_underrun_error');
2 changes: 1 addition & 1 deletion lib/nodejs/test/exceptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"use strict";
const test = require("tape");
const thrift = require("../lib/thrift/thrift.js");
const InputBufferUnderrunError = require("../lib/thrift/input_buffer_underrun_error");
const { InputBufferUnderrunError } = require("../lib/thrift");

test("TApplicationException", function t(assert) {
const e = new thrift.TApplicationException(1, "foo");
Expand Down

0 comments on commit 7fe4bf5

Please sign in to comment.