Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## v0.7.7-alpha

- Exported EmptyRelationError

## v0.7.6-alpha

- Added an error to handle empty relation size of 0 bytes when reading arrow files
Expand Down
1 change: 1 addition & 0 deletions index.web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export type { SdkError } from './src/errors';
export {
AbortError,
ApiError,
EmptyRelationError,
MaxRelationSizeError,
TransactionError,
} from './src/errors';
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@relationalai/rai-sdk-javascript",
"description": "RelationalAI SDK for JavaScript",
"version": "0.7.6-alpha",
"version": "0.7.7-alpha",
"author": {
"name": "RelationalAI",
"url": "https://relational.ai"
Expand Down
4 changes: 2 additions & 2 deletions src/api/transaction/transactionUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import { tableFromIPC } from 'apache-arrow';

import { EmptyRelationSizeError, MaxRelationSizeError } from '../../errors';
import { EmptyRelationError, MaxRelationSizeError } from '../../errors';
import { MetadataInfo } from '../../proto/generated/message';
import { RelationId } from '../../proto/generated/schema';
import {
Expand Down Expand Up @@ -96,7 +96,7 @@ export async function readArrowFiles(files: TransactionAsyncFile[]) {
// all the remaining parts are empty as well in Windows’s Chrome,
// therefore, throwing the error here to avoid failures downstream
if (file.file.size === 0) {
throw new EmptyRelationSizeError(file.name);
throw new EmptyRelationError(file.name);
}

const table = await tableFromIPC(file.file.stream());
Expand Down
8 changes: 4 additions & 4 deletions src/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ export class MaxRelationSizeError extends Error {
}
}

export class EmptyRelationSizeError extends Error {
export class EmptyRelationError extends Error {
constructor(public relationId: string) {
const message = `Empty relation size of 0 bytes. Relation: ${relationId}`;
const message = `Unexpected 0 bytes relation. Relation: ${relationId}`;

super(message);

this.name = 'EmptyRelationSizeError';
this.name = 'EmptyRelationError';
}
}

Expand All @@ -109,5 +109,5 @@ export type SdkError =
| ApiError
| TransactionError
| MaxRelationSizeError
| EmptyRelationSizeError
| EmptyRelationError
| Error;