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
3 changes: 3 additions & 0 deletions docs/src/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2399,6 +2399,9 @@ components:
18 - Internal: Unexpected server/implementation error
19 - InvalidTableState: Table is in an invalid state for the operation
20 - TableSchemaValidationError: Table schema validation failed
21 - Throttling: Request rate limit exceeded
22 - TableBranchNotFound: The specified table branch does not exist
23 - TableBranchAlreadyExists: A table branch with this name already exists
example: 4
detail:
type: string
Expand Down
3 changes: 3 additions & 0 deletions java/lance-namespace-apache-client/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3278,6 +3278,9 @@ components:
18 - Internal: Unexpected server/implementation error
19 - InvalidTableState: Table is in an invalid state for the operation
20 - TableSchemaValidationError: Table schema validation failed
21 - Throttling: Request rate limit exceeded
22 - TableBranchNotFound: The specified table branch does not exist
23 - TableBranchAlreadyExists: A table branch with this name already exists
example: 4
minimum: 0
type: integer
Expand Down
2 changes: 1 addition & 1 deletion java/lance-namespace-apache-client/docs/ErrorResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Common JSON error response model
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**error** | **String** | A brief, human-readable message about the error. | [optional] |
|**code** | **Integer** | Lance Namespace error code identifying the error type. Error codes: 0 - Unsupported: Operation not supported by this backend 1 - NamespaceNotFound: The specified namespace does not exist 2 - NamespaceAlreadyExists: A namespace with this name already exists 3 - NamespaceNotEmpty: Namespace contains tables or child namespaces 4 - TableNotFound: The specified table does not exist 5 - TableAlreadyExists: A table with this name already exists 6 - TableIndexNotFound: The specified table index does not exist 7 - TableIndexAlreadyExists: A table index with this name already exists 8 - TableTagNotFound: The specified table tag does not exist 9 - TableTagAlreadyExists: A table tag with this name already exists 10 - TransactionNotFound: The specified transaction does not exist 11 - TableVersionNotFound: The specified table version does not exist 12 - TableColumnNotFound: The specified table field does not exist 13 - InvalidInput: Malformed request or invalid parameters 14 - ConcurrentModification: Optimistic concurrency conflict 15 - PermissionDenied: User lacks permission for this operation 16 - Unauthenticated: Authentication credentials are missing or invalid 17 - ServiceUnavailable: Service is temporarily unavailable 18 - Internal: Unexpected server/implementation error 19 - InvalidTableState: Table is in an invalid state for the operation 20 - TableSchemaValidationError: Table schema validation failed | |
|**code** | **Integer** | Lance Namespace error code identifying the error type. Error codes: 0 - Unsupported: Operation not supported by this backend 1 - NamespaceNotFound: The specified namespace does not exist 2 - NamespaceAlreadyExists: A namespace with this name already exists 3 - NamespaceNotEmpty: Namespace contains tables or child namespaces 4 - TableNotFound: The specified table does not exist 5 - TableAlreadyExists: A table with this name already exists 6 - TableIndexNotFound: The specified table index does not exist 7 - TableIndexAlreadyExists: A table index with this name already exists 8 - TableTagNotFound: The specified table tag does not exist 9 - TableTagAlreadyExists: A table tag with this name already exists 10 - TransactionNotFound: The specified transaction does not exist 11 - TableVersionNotFound: The specified table version does not exist 12 - TableColumnNotFound: The specified table field does not exist 13 - InvalidInput: Malformed request or invalid parameters 14 - ConcurrentModification: Optimistic concurrency conflict 15 - PermissionDenied: User lacks permission for this operation 16 - Unauthenticated: Authentication credentials are missing or invalid 17 - ServiceUnavailable: Service is temporarily unavailable 18 - Internal: Unexpected server/implementation error 19 - InvalidTableState: Table is in an invalid state for the operation 20 - TableSchemaValidationError: Table schema validation failed 21 - Throttling: Request rate limit exceeded 22 - TableBranchNotFound: The specified table branch does not exist 23 - TableBranchAlreadyExists: A table branch with this name already exists | |
|**detail** | **String** | An optional human-readable explanation of the error. This can be used to record additional information such as stack trace. | [optional] |
|**instance** | **String** | A string that identifies the specific occurrence of the error. This can be a URI, a request or response ID, or anything that the implementation can recognize to trace specific occurrence of the error. | [optional] |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ public ErrorResponse code(@javax.annotation.Nonnull Integer code) {
* Unauthenticated: Authentication credentials are missing or invalid 17 - ServiceUnavailable:
* Service is temporarily unavailable 18 - Internal: Unexpected server/implementation error 19 -
* InvalidTableState: Table is in an invalid state for the operation 20 -
* TableSchemaValidationError: Table schema validation failed minimum: 0
* TableSchemaValidationError: Table schema validation failed 21 - Throttling: Request rate limit
* exceeded 22 - TableBranchNotFound: The specified table branch does not exist 23 -
* TableBranchAlreadyExists: A table branch with this name already exists minimum: 0
*
* @return code
*/
Expand Down
3 changes: 3 additions & 0 deletions java/lance-namespace-async-client/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3278,6 +3278,9 @@ components:
18 - Internal: Unexpected server/implementation error
19 - InvalidTableState: Table is in an invalid state for the operation
20 - TableSchemaValidationError: Table schema validation failed
21 - Throttling: Request rate limit exceeded
22 - TableBranchNotFound: The specified table branch does not exist
23 - TableBranchAlreadyExists: A table branch with this name already exists
example: 4
minimum: 0
type: integer
Expand Down
2 changes: 1 addition & 1 deletion java/lance-namespace-async-client/docs/ErrorResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Common JSON error response model
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**error** | **String** | A brief, human-readable message about the error. | [optional] |
|**code** | **Integer** | Lance Namespace error code identifying the error type. Error codes: 0 - Unsupported: Operation not supported by this backend 1 - NamespaceNotFound: The specified namespace does not exist 2 - NamespaceAlreadyExists: A namespace with this name already exists 3 - NamespaceNotEmpty: Namespace contains tables or child namespaces 4 - TableNotFound: The specified table does not exist 5 - TableAlreadyExists: A table with this name already exists 6 - TableIndexNotFound: The specified table index does not exist 7 - TableIndexAlreadyExists: A table index with this name already exists 8 - TableTagNotFound: The specified table tag does not exist 9 - TableTagAlreadyExists: A table tag with this name already exists 10 - TransactionNotFound: The specified transaction does not exist 11 - TableVersionNotFound: The specified table version does not exist 12 - TableColumnNotFound: The specified table field does not exist 13 - InvalidInput: Malformed request or invalid parameters 14 - ConcurrentModification: Optimistic concurrency conflict 15 - PermissionDenied: User lacks permission for this operation 16 - Unauthenticated: Authentication credentials are missing or invalid 17 - ServiceUnavailable: Service is temporarily unavailable 18 - Internal: Unexpected server/implementation error 19 - InvalidTableState: Table is in an invalid state for the operation 20 - TableSchemaValidationError: Table schema validation failed | |
|**code** | **Integer** | Lance Namespace error code identifying the error type. Error codes: 0 - Unsupported: Operation not supported by this backend 1 - NamespaceNotFound: The specified namespace does not exist 2 - NamespaceAlreadyExists: A namespace with this name already exists 3 - NamespaceNotEmpty: Namespace contains tables or child namespaces 4 - TableNotFound: The specified table does not exist 5 - TableAlreadyExists: A table with this name already exists 6 - TableIndexNotFound: The specified table index does not exist 7 - TableIndexAlreadyExists: A table index with this name already exists 8 - TableTagNotFound: The specified table tag does not exist 9 - TableTagAlreadyExists: A table tag with this name already exists 10 - TransactionNotFound: The specified transaction does not exist 11 - TableVersionNotFound: The specified table version does not exist 12 - TableColumnNotFound: The specified table field does not exist 13 - InvalidInput: Malformed request or invalid parameters 14 - ConcurrentModification: Optimistic concurrency conflict 15 - PermissionDenied: User lacks permission for this operation 16 - Unauthenticated: Authentication credentials are missing or invalid 17 - ServiceUnavailable: Service is temporarily unavailable 18 - Internal: Unexpected server/implementation error 19 - InvalidTableState: Table is in an invalid state for the operation 20 - TableSchemaValidationError: Table schema validation failed 21 - Throttling: Request rate limit exceeded 22 - TableBranchNotFound: The specified table branch does not exist 23 - TableBranchAlreadyExists: A table branch with this name already exists | |
|**detail** | **String** | An optional human-readable explanation of the error. This can be used to record additional information such as stack trace. | [optional] |
|**instance** | **String** | A string that identifies the specific occurrence of the error. This can be a URI, a request or response ID, or anything that the implementation can recognize to trace specific occurrence of the error. | [optional] |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ public ErrorResponse code(@javax.annotation.Nonnull Integer code) {
* Unauthenticated: Authentication credentials are missing or invalid 17 - ServiceUnavailable:
* Service is temporarily unavailable 18 - Internal: Unexpected server/implementation error 19 -
* InvalidTableState: Table is in an invalid state for the operation 20 -
* TableSchemaValidationError: Table schema validation failed minimum: 0
* TableSchemaValidationError: Table schema validation failed 21 - Throttling: Request rate limit
* exceeded 22 - TableBranchNotFound: The specified table branch does not exist 23 -
* TableBranchAlreadyExists: A table branch with this name already exists minimum: 0
*
* @return code
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ public enum ErrorCode {
INTERNAL(18, "Internal error"),
INVALID_TABLE_STATE(19, "Invalid table state"),
TABLE_SCHEMA_VALIDATION_ERROR(20, "Table schema validation error"),
THROTTLING(21, "Request rate limit exceeded");
THROTTLING(21, "Request rate limit exceeded"),
TABLE_BRANCH_NOT_FOUND(22, "Table branch not found"),
TABLE_BRANCH_ALREADY_EXISTS(23, "Table branch already exists");

private final int code;
private final String description;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ public static LanceNamespaceException fromErrorCode(
return new TableSchemaValidationException(message, detail, instance);
case THROTTLING:
return new ThrottlingException(message, detail, instance);
case TABLE_BRANCH_NOT_FOUND:
return new TableBranchNotFoundException(message, detail, instance);
case TABLE_BRANCH_ALREADY_EXISTS:
return new TableBranchAlreadyExistsException(message, detail, instance);
default:
return new InternalException(message, detail, instance);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.lance.namespace.async.errors;

import javax.annotation.Nullable;

/** Thrown when a table branch with the specified name already exists. */
public class TableBranchAlreadyExistsException extends LanceNamespaceException {
public TableBranchAlreadyExistsException(String message) {
super(ErrorCode.TABLE_BRANCH_ALREADY_EXISTS, message);
}

public TableBranchAlreadyExistsException(String message, Throwable cause) {
super(ErrorCode.TABLE_BRANCH_ALREADY_EXISTS, message, cause);
}

public TableBranchAlreadyExistsException(
String message, @Nullable String detail, @Nullable String instance) {
super(ErrorCode.TABLE_BRANCH_ALREADY_EXISTS, message, detail, instance);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.lance.namespace.async.errors;

import javax.annotation.Nullable;

/** Thrown when the specified table branch does not exist. */
public class TableBranchNotFoundException extends LanceNamespaceException {
public TableBranchNotFoundException(String message) {
super(ErrorCode.TABLE_BRANCH_NOT_FOUND, message);
}

public TableBranchNotFoundException(String message, Throwable cause) {
super(ErrorCode.TABLE_BRANCH_NOT_FOUND, message, cause);
}

public TableBranchNotFoundException(
String message, @Nullable String detail, @Nullable String instance) {
super(ErrorCode.TABLE_BRANCH_NOT_FOUND, message, detail, instance);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ public enum ErrorCode {
INTERNAL(18, "Internal error"),
INVALID_TABLE_STATE(19, "Invalid table state"),
TABLE_SCHEMA_VALIDATION_ERROR(20, "Table schema validation error"),
THROTTLING(21, "Request rate limit exceeded");
THROTTLING(21, "Request rate limit exceeded"),
TABLE_BRANCH_NOT_FOUND(22, "Table branch not found"),
TABLE_BRANCH_ALREADY_EXISTS(23, "Table branch already exists");

private final int code;
private final String description;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ public static LanceNamespaceException fromErrorCode(
return new TableSchemaValidationException(message, detail, instance);
case THROTTLING:
return new ThrottlingException(message, detail, instance);
case TABLE_BRANCH_NOT_FOUND:
return new TableBranchNotFoundException(message, detail, instance);
case TABLE_BRANCH_ALREADY_EXISTS:
return new TableBranchAlreadyExistsException(message, detail, instance);
default:
return new InternalException(message, detail, instance);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.lance.namespace.errors;

import javax.annotation.Nullable;

/** Thrown when a table branch with the specified name already exists. */
public class TableBranchAlreadyExistsException extends LanceNamespaceException {
public TableBranchAlreadyExistsException(String message) {
super(ErrorCode.TABLE_BRANCH_ALREADY_EXISTS, message);
}

public TableBranchAlreadyExistsException(String message, Throwable cause) {
super(ErrorCode.TABLE_BRANCH_ALREADY_EXISTS, message, cause);
}

public TableBranchAlreadyExistsException(
String message, @Nullable String detail, @Nullable String instance) {
super(ErrorCode.TABLE_BRANCH_ALREADY_EXISTS, message, detail, instance);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.lance.namespace.errors;

import javax.annotation.Nullable;

/** Thrown when the specified table branch does not exist. */
public class TableBranchNotFoundException extends LanceNamespaceException {
public TableBranchNotFoundException(String message) {
super(ErrorCode.TABLE_BRANCH_NOT_FOUND, message);
}

public TableBranchNotFoundException(String message, Throwable cause) {
super(ErrorCode.TABLE_BRANCH_NOT_FOUND, message, cause);
}

public TableBranchNotFoundException(
String message, @Nullable String detail, @Nullable String instance) {
super(ErrorCode.TABLE_BRANCH_NOT_FOUND, message, detail, instance);
}
}
Loading
Loading