Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,9 @@ public static class CodeDeployment {

/** Deployment unit write to fs error. */
public static final int UNIT_WRITE_ERR = CODE_DEPLOYMENT_ERR_GROUP.registerErrorCode((short) 6);

/** Duplicate filenames in the unit content. */
public static final int UNIT_NON_UNIQUE_FILENAMES_ERR = CODE_DEPLOYMENT_ERR_GROUP.registerErrorCode((short) 7);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,7 @@ private CompletableFuture<Boolean> doDeploy(
}
LOG.warn("Failed to deploy meta of unit " + id + ":" + version + " to metastore. "
+ "Already exists.");
return failedFuture(
new DeploymentUnitAlreadyExistsException(id,
"Unit " + id + ":" + version + " already exists"));
return failedFuture(new DeploymentUnitAlreadyExistsException("Unit " + id + ":" + version + " already exists"));
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,15 @@
import org.apache.ignite.lang.IgniteException;

/**
* Throws when trying to deploy unit which already exist.
* Throws when trying to deploy unit which already exists.
*/
public class DeploymentUnitAlreadyExistsException extends IgniteException {
/**
* Unit identifier.
*/
private final String id;

/**
* Constructor.
*
* @param id Unit identifier.
* @param message Error message.
*/
public DeploymentUnitAlreadyExistsException(String id, String message) {
public DeploymentUnitAlreadyExistsException(String message) {
super(CodeDeployment.UNIT_ALREADY_EXISTS_ERR, message);
this.id = id;
}

public String id() {
return id;
}
}
1 change: 1 addition & 0 deletions modules/platforms/cpp/ignite/common/error_codes.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ enum class code : underlying_t {
UNIT_UNAVAILABLE = 0xd0004,
UNIT_ZIP = 0xd0005,
UNIT_WRITE = 0xd0006,
UNIT_NON_UNIQUE_FILENAMES = 0xd0007,

// GarbageCollector group. Group code: 14
CLOSED = 0xe0001,
Expand Down
1 change: 1 addition & 0 deletions modules/platforms/cpp/ignite/odbc/common_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ sql_state error_code_to_sql_state(error::code code) {
case error::code::UNIT_UNAVAILABLE:
case error::code::UNIT_ZIP:
case error::code::UNIT_WRITE:
case error::code::UNIT_NON_UNIQUE_FILENAMES:
return sql_state::SHY000_GENERAL_ERROR;

// GarbageCollector group. Group code: 14
Expand Down
5 changes: 4 additions & 1 deletion modules/platforms/dotnet/Apache.Ignite/ErrorCodes.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public static class Client
/// <summary> ResourceNotFound error. </summary>
public const int ResourceNotFound = (GroupCode << 16) | (10 & 0xFFFF);

/// <summary> Client operation timeout. </summary>
/// <summary> OperationTimeout error. </summary>
public const int OperationTimeout = (GroupCode << 16) | (11 & 0xFFFF);
}

Expand Down Expand Up @@ -542,6 +542,9 @@ public static class CodeDeployment

/// <summary> UnitWrite error. </summary>
public const int UnitWrite = (GroupCode << 16) | (6 & 0xFFFF);

/// <summary> UnitNonUniqueFilenames error. </summary>
public const int UnitNonUniqueFilenames = (GroupCode << 16) | (7 & 0xFFFF);
}

/// <summary> GarbageCollector errors. </summary>
Expand Down
5 changes: 4 additions & 1 deletion modules/platforms/python/cpp_module/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,10 @@ void set_error(const ignite::ignite_error &error) {
case ignite::error::code::UNIT_NOT_FOUND:
case ignite::error::code::UNIT_ALREADY_EXISTS:
case ignite::error::code::UNIT_CONTENT_READ:
case ignite::error::code::UNIT_UNAVAILABLE: {
case ignite::error::code::UNIT_UNAVAILABLE:
case ignite::error::code::UNIT_ZIP:
case ignite::error::code::UNIT_WRITE:
case ignite::error::code::UNIT_NON_UNIQUE_FILENAMES: {
error_class = py_get_module_database_error_class();
break;
}
Expand Down
Loading