summaryrefslogtreecommitdiff
path: root/indra/llkdu
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2016-08-17 11:41:12 -0400
committerNat Goodspeed <nat@lindenlab.com>2016-08-17 11:41:12 -0400
commite72bdc9bc5895267f77bf3eac8d68f82f5e2806b (patch)
treebb86f9ae3e199a994ec5e2255d9af0de3fa17c95 /indra/llkdu
parent4fb100ac7a33174883184f1320d0beac08ead3a7 (diff)
parent5e9d2f57c82a57307a48afea09aa539b9fa80abf (diff)
Automated merge with ssh://bitbucket.org/lindenlab/viewer-release
Diffstat (limited to 'indra/llkdu')
-rw-r--r--indra/llkdu/llimagej2ckdu.cpp27
1 files changed, 18 insertions, 9 deletions
diff --git a/indra/llkdu/llimagej2ckdu.cpp b/indra/llkdu/llimagej2ckdu.cpp
index 9347e51b85..fe79079db3 100644
--- a/indra/llkdu/llimagej2ckdu.cpp
+++ b/indra/llkdu/llimagej2ckdu.cpp
@@ -34,6 +34,15 @@
#include "kdu_block_coding.h"
+#include "llexception.h"
+
+namespace {
+struct KDUError: public LLException
+{
+ KDUError(const std::string& msg): LLException(msg) {}
+};
+} // anonymous namespace
+
class kdc_flow_control {
public:
@@ -167,7 +176,7 @@ struct LLKDUMessageError : public LLKDUMessage
// exception if we want to recover from a KDU error.
if (end_of_message)
{
- throw "KDU throwing an exception";
+ LLTHROW(KDUError("LLKDUMessageError::flush()"));
}
}
};
@@ -384,9 +393,9 @@ bool LLImageJ2CKDU::initDecode(LLImageJ2C &base, LLImageRaw &raw_image, F32 deco
mTPosp->x = 0;
}
}
- catch (const char* msg)
+ catch (const KDUError& msg)
{
- base.setLastError(ll_safe_string(msg));
+ base.setLastError(msg.what());
return false;
}
catch (...)
@@ -480,9 +489,9 @@ bool LLImageJ2CKDU::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 deco
return false;
}
}
- catch (const char* msg)
+ catch (const KDUError& msg)
{
- base.setLastError(ll_safe_string(msg));
+ base.setLastError(msg.what());
base.decodeFailed();
cleanupCodeStream();
return true; // done
@@ -673,9 +682,9 @@ bool LLImageJ2CKDU::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, co
base.updateData(); // set width, height
delete[] output_buffer;
}
- catch(const char* msg)
+ catch(const KDUError& msg)
{
- base.setLastError(ll_safe_string(msg));
+ base.setLastError(msg.what());
return false;
}
catch( ... )
@@ -697,9 +706,9 @@ bool LLImageJ2CKDU::getMetadata(LLImageJ2C &base)
setupCodeStream(base, false, MODE_FAST);
return true;
}
- catch (const char* msg)
+ catch (const KDUError& msg)
{
- base.setLastError(ll_safe_string(msg));
+ base.setLastError(msg.what());
return false;
}
catch (...)