From 5fa27adfcd306e16159baad5d50b3150481f9bb6 Mon Sep 17 00:00:00 2001 From: castano Date: Wed, 19 Nov 2008 08:10:54 +0000 Subject: [PATCH] Add custom error code and message for the case when container format does not support a certain output format. --- src/nvtt/Compressor.cpp | 2 +- src/nvtt/nvtt.cpp | 2 ++ src/nvtt/nvtt.h | 1 + src/nvtt/nvtt_wrapper.h | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/nvtt/Compressor.cpp b/src/nvtt/Compressor.cpp index 197e480..f871d6c 100644 --- a/src/nvtt/Compressor.cpp +++ b/src/nvtt/Compressor.cpp @@ -493,7 +493,7 @@ bool Compressor::Private::outputHeader(const InputOptions::Private & inputOption // This container does not support the requested format. if (outputOptions.errorHandler != NULL) { - outputOptions.errorHandler->error(Error_UnsupportedFeature); + outputOptions.errorHandler->error(Error_UnsupportedOutputFormat); } return false; diff --git a/src/nvtt/nvtt.cpp b/src/nvtt/nvtt.cpp index 5c9e884..8dc5cb5 100644 --- a/src/nvtt/nvtt.cpp +++ b/src/nvtt/nvtt.cpp @@ -42,6 +42,8 @@ const char * nvtt::errorString(Error e) return "Error opening file"; case Error_FileWrite: return "Error writing through output handler"; + case Error_UnsupportedOutputFormat: + return "The container file does not support the selected output format"; } return "Invalid error"; diff --git a/src/nvtt/nvtt.h b/src/nvtt/nvtt.h index 05194b7..0e76369 100644 --- a/src/nvtt/nvtt.h +++ b/src/nvtt/nvtt.h @@ -280,6 +280,7 @@ namespace nvtt Error_CudaError, Error_FileOpen, Error_FileWrite, + Error_UnsupportedOutputFormat, }; /// Error handler. diff --git a/src/nvtt/nvtt_wrapper.h b/src/nvtt/nvtt_wrapper.h index b51a96a..d7c94f7 100644 --- a/src/nvtt/nvtt_wrapper.h +++ b/src/nvtt/nvtt_wrapper.h @@ -156,6 +156,7 @@ typedef enum NVTT_Error_Unknown, NVTT_Error_FileOpen, NVTT_Error_FileWrite, + NVTT_Error_UnsupportedOutputFormat, } NvttError; typedef enum