Add custom error code and message for the case when container format does not support a certain output format.

This commit is contained in:
castano 2008-11-19 08:10:54 +00:00
parent 6d1891a7e9
commit 5fa27adfcd
4 changed files with 5 additions and 1 deletions

View File

@ -493,7 +493,7 @@ bool Compressor::Private::outputHeader(const InputOptions::Private & inputOption
// This container does not support the requested format. // This container does not support the requested format.
if (outputOptions.errorHandler != NULL) if (outputOptions.errorHandler != NULL)
{ {
outputOptions.errorHandler->error(Error_UnsupportedFeature); outputOptions.errorHandler->error(Error_UnsupportedOutputFormat);
} }
return false; return false;

View File

@ -42,6 +42,8 @@ const char * nvtt::errorString(Error e)
return "Error opening file"; return "Error opening file";
case Error_FileWrite: case Error_FileWrite:
return "Error writing through output handler"; return "Error writing through output handler";
case Error_UnsupportedOutputFormat:
return "The container file does not support the selected output format";
} }
return "Invalid error"; return "Invalid error";

View File

@ -280,6 +280,7 @@ namespace nvtt
Error_CudaError, Error_CudaError,
Error_FileOpen, Error_FileOpen,
Error_FileWrite, Error_FileWrite,
Error_UnsupportedOutputFormat,
}; };
/// Error handler. /// Error handler.

View File

@ -156,6 +156,7 @@ typedef enum
NVTT_Error_Unknown, NVTT_Error_Unknown,
NVTT_Error_FileOpen, NVTT_Error_FileOpen,
NVTT_Error_FileWrite, NVTT_Error_FileWrite,
NVTT_Error_UnsupportedOutputFormat,
} NvttError; } NvttError;
typedef enum typedef enum