trxcllnt commented on code in PR #389:
URL: https://github.com/apache/arrow-js/pull/389#discussion_r2891183588


##########
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:
   ```suggestion
                   this.close();
                   throw new Error(
                       `RecordBatch schema does not match the writer's 
schema.\n` +
                       `  Expected: ${this._schema}\n` +
                       `  Received: ${schema}`
                   );
   ```



-- 
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]

Reply via email to