trxcllnt commented on code in PR #389:
URL: https://github.com/apache/arrow-js/pull/389#discussion_r2891130947
##########
src/ipc/writer.ts:
##########
@@ -203,7 +205,11 @@ export class RecordBatchWriter<T extends TypeMap = any>
extends ReadableInterop<
if (schema && !compareSchemas(schema, this._schema)) {
if (this._started && this._autoDestroy) {
- return this.close();
+ throw new Error(
+ `RecordBatch schema does not match the writer's schema.\n`
+
+ ` Expected: ${this._schema}\n` +
+ ` Received: ${schema}`
+ );
Review Comment:
How about this instead? Setting this to null should cause the next `write()`
to throw [an
error](https://github.com/apache/arrow-js/blob/ed42d662c221f3748d75566bfa1ce3f13ee026a6/src/ipc/writer.ts#L195):
```suggestion
this.close();
this._sink = null;
return;
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]