Result Structures

resources returns as much useful information as possible to the caller.

This is especially important when encountering errors.

struct Result

Return structure for resources operations.

Public Members

ResultType type = ResultType::SUCCESS

Type of result returned

std::string info = ""

Optional further information on the return

enum class CarbonResources::ResultType

Values:

enumerator SUCCESS

Operation was successful.

enumerator FAIL

Operation failed. This is an internal library error which shouldn’t be encountered. If you encounter this error contact API addministrators.

enumerator UNSUPPORTED_FILE_FORMAT

Operation encounted an unsupported file format. It is likely that supplied file format is unsupported.

enumerator FAILED_TO_OPEN_FILE

A file failed to open during operation. Perhaps the file was not found, or is locked.

enumerator MALFORMED_RESOURCE_INPUT

A malformed resource was encountered. This may be related to required missing fields required for document version.

enumerator FILE_TYPE_MISMATCH

The document type being imported didn’t match expected type for operation.

enumerator DOCUMENT_VERSION_UNSUPPORTED

Document major version is greater than library max version. Library needs updating.

enumerator REQUIRED_RESOURCE_PARAMETER_NOT_SET

Resource parameter that is required for the document version has not been set.

enumerator FAILED_TO_OPEN_FILE_STREAM

Failed to open file stream during operation.Perhaps the file was not found, or is locked.

enumerator FAILED_TO_READ_FROM_STREAM

An error was encountered while attempting to read from stream.

enumerator FAILED_TO_WRITE_TO_STREAM

An error was encountered while attempting to write to a stream.

enumerator FAILED_TO_DOWNLOAD_FILE

A file failed to download during operation. Check supplied URLS are correct.

enumerator FAILED_TO_CREATE_PATCH

An error occurred during generation of a binary patch.

enumerator FAILED_TO_SAVE_FILE

Operation failed to save a file.

enumerator FAILED_TO_GENERATE_CHECKSUM

An error occurred during generation of a data checksum.

enumerator FAILED_TO_GENERATE_RELATIVE_PATH_CHECKSUM

An error occurred during generation of a relative path checksum.

enumerator FAILED_TO_COMPRESS_DATA

An error occurred during data compression.

enumerator PATCH_RESOURCE_LIST_MISSMATCH

ResourceGroups provided to create patch do not match in type. Validate ResourceGroup inputs are correct.

enumerator FAILED_TO_APPLY_PATCH

An error occurred during application of a binary patch.

enumerator UNEXPECTED_PATCH_CHECKSUM_RESULT

Patched resource doesn’t match expected checksum upon patch completion.

enumerator UNEXPECTED_PATCH_DIFF_ENCOUNTERED

ResourceGroup diff operation produced unexpected result. This is an internal library error.

enumerator FILE_NOT_FOUND

Required file not found. Validate parameter inputs.

enumerator FAILED_TO_RETRIEVE_CHUNK_DATA

An error was encountered while attempting to read from a chunk data stream.

enumerator RESOURCE_VALUE_NOT_SET

A request was made for a parameter which was not set. This is an internal library error.

enumerator UNEXPECTED_END_OF_CHUNKS

Chunk file finished before all expected chunks had reconstituted.

enumerator UNEXPECTED_CHUNK_CHECKSUM_RESULT

Generated checksum didn’t match expected result.

enumerator FAILED_TO_SAVE_TO_STREAM

An error was encountered while attempting to write to a stream.

enumerator INPUT_DIRECTORY_DOESNT_EXIST

Supplied input directory doesn’t exist. Validate parameter inputs.

enumerator RESOURCE_TYPE_MISSMATCH

Resource parameters were attempted to be set by a resource of a different type. This is an internal library error which shouldn’t be encountered. If you encounter this error contact API addministrators.

enumerator MALFORMED_RESOURCE_GROUP

Resource group provided appears malformed.

enumerator MALFORMED_RESOURCE

Resource provided appears malformed.

enumerator FAILED_TO_PARSE_YAML

Failed to parse provided yaml.

enumerator INVALID_CHUNK_SIZE

Chunk size must be > 0.

enumerator RESOURCE_GROUP_NOT_SET

Resource Group is null

enumerator RESOURCE_LIST_NOT_SET

Required resource List is not set

enumerator RESOURCE_NOT_FOUND

Required resource not found

enumerator REQUIRED_INPUT_PARAMETER_NOT_SET

A required input parameter was not set

bool CarbonResources::ResultTypeToString(ResultType resultType, std::string &output)

Converts ResultType to string

Parameters:
  • resultTypeResult type to be converted.

  • output – Output to string conversion.