Skip to content

Commit

Permalink
Renamed error codes (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
ckunki authored Mar 16, 2023
1 parent f9332e7 commit e5d5d6e
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 11 deletions.
3 changes: 2 additions & 1 deletion doc/changes/changes_2.4.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ Code name: Maintenance

## Summary

Updated dependencies to replace `com.exasol:exasol-script-api` by `udf-api-java/1.0.1` as `com.exasol:exasol-script-api` had been available on discontinued maven repository `maven.exasol.com`.
Renamed error codes from `VS-ORA` to `VSORA` and updated dependencies to replace `com.exasol:exasol-script-api` by `udf-api-java/1.0.1` as `com.exasol:exasol-script-api` had been available on discontinued maven repository `maven.exasol.com`.

Please note that updated dependency `virtual-schema-common-jdbc` adds support for a new adapter property [`MAX_TABLE_COUNT`](https://github.com/exasol/virtual-schema-common-jdbc#property-max_table_count) and fixes ambiguous results by escaping SQL wildcards such as underscore `_` and percent `%` in names of catalogs, schemas, and tables when retrieving column metadata from JDBC driver.

## Bugfixes

* #25: Renamed error codes from `VS-ORA` to `VSORA`.
* #30: Updated dependencies

## Dependency Updates
Expand Down
2 changes: 1 addition & 1 deletion error_code_config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error-tags:
VS-ORA:
VSORA:
packages:
- com.exasol.adapter.dialects.oracle
- com.exasol.closeafterall
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ private String buildImportFromOraConnectionDefinition(final AdapterProperties pr
if (properties.containsKey(ORACLE_CONNECTION_NAME_PROPERTY)) {
return buildOracleConnectionDefinitionFromOracleConnectionOnly(properties);
} else {
throw new IllegalArgumentException(ExaError.messageBuilder("E-VS-ORA-3")
throw new IllegalArgumentException(ExaError.messageBuilder("E-VSORA-3")
.message("If you enable IMPORT FROM ORA with property {{OracleImportProperty}} "
+ "you also need to provide the name of an Oracle connection with {{OracleConnectionNameProperty}}.")
.parameter("OracleImportProperty", ORACLE_IMPORT_PROPERTY)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static OracleIdentifier of(final String id) {
if (validate(id)) {
return new OracleIdentifier(id);
} else {
throw new AssertionError(ExaError.messageBuilder("E-VS-ORA-2")
throw new AssertionError(ExaError.messageBuilder("E-VSORA-2")
.message("Unable to create identifier {{id}} because it contains illegal characters." //
+ " For information about valid identifiers, please refer to" //
+ " https://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements008.htm")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ protected RemoteMetadataReader createRemoteMetadataReader() {
try {
return new OracleMetadataReader(this.connectionFactory.getConnection(), this.properties);
} catch (final SQLException exception) {
throw new RemoteMetadataReaderException(ExaError.messageBuilder("E-VS-ORA-1")
throw new RemoteMetadataReaderException(ExaError.messageBuilder("E-VSORA-1")
.message("Unable to create Oracle remote metadata reader. Caused by: {{cause|uq}}")
.parameter("cause", exception.getMessage()).toString(), exception);
}
Expand All @@ -182,7 +182,7 @@ protected QueryRewriter createQueryRewriter() {
return new OracleQueryRewriter(this, this.createRemoteMetadataReader(),
this.connectionFactory.getConnection(), this.properties);
} catch (final SQLException exception) {
throw new RemoteMetadataReaderException(ExaError.messageBuilder("E-VS-ORA-4")
throw new RemoteMetadataReaderException(ExaError.messageBuilder("E-VSORA-4")
.message("Unable to create Oracle remote metadata reader. Caused by: {{cause|uq}}")
.parameter("cause", exception.getMessage()).toString(), exception);
}
Expand All @@ -194,4 +194,4 @@ protected QueryRewriter createQueryRewriter() {
private boolean isImportFromOraEnabled() {
return this.properties.isEnabled(OracleProperties.ORACLE_IMPORT_PROPERTY);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ void testBuildConnectionDefinitionMissingPropertyException() {
CONNECTION_NAME_PROPERTY, "ora_connection"));
final IllegalArgumentException exception = assertThrows(IllegalArgumentException.class,
() -> this.connectionDefinitionBuilder.buildConnectionDefinition(properties, null));
assertThat(exception.getMessage(), containsString("E-VS-ORA-3"));
assertThat(exception.getMessage(), containsString("E-VSORA-3"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void testCreateValidIdentifier(final String identifier) {
@ValueSource(strings = { "\"testtable\"", "test\"table" })
void testCreateInvalidIdentifier(final String identifier) {
final AssertionError assertionError = assertThrows(AssertionError.class, () -> OracleIdentifier.of(identifier));
assertThat(assertionError.getMessage(), containsString("E-VS-ORA-2"));
assertThat(assertionError.getMessage(), containsString("E-VSORA-2"));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ void testCreateRemoteMetadataReaderConnectionFails() throws SQLException {
when(this.connectionFactoryMock.getConnection()).thenThrow(new SQLException());
final RemoteMetadataReaderException exception = assertThrows(RemoteMetadataReaderException.class,
this.dialect::createRemoteMetadataReader);
assertThat(exception.getMessage(), containsString("E-VS-ORA-1"));
assertThat(exception.getMessage(), containsString("E-VSORA-1"));
}

@CsvSource({ "FALSE, FALSE, JDBC", //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ private void closeObject(final Field field, final Object annotatedObject) throws
if (annotatedObject instanceof Closeable) {
((Closeable) annotatedObject).close();
} else {
throw new IllegalStateException(ExaError.messageBuilder("E-VS-ORA-9").message(
throw new IllegalStateException(ExaError.messageBuilder("E-VSORA-9").message(
"Could not close the field {{field}} annotated with @CloseAfterAll since it does not implement Closable.")
.parameter("field", field.getName()).toString());
}
Expand Down

0 comments on commit e5d5d6e

Please sign in to comment.