From 4be42b3f75bc2c19381a59c3980d00ffb189883e Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Wed, 2 Nov 2011 18:40:49 +0000 Subject: [PATCH] Get some hopefully more useful exception information when OpenJPEG.EncodeFromImage() fails in VectorRender and DynamicTexture modules --- .../Scripting/DynamicTexture/DynamicTextureModule.cs | 6 ++++-- .../Scripting/VectorRender/VectorRenderModule.cs | 7 ++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs index 678e7723ff..029879a67f 100644 --- a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs @@ -396,9 +396,11 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture { result = OpenJPEG.EncodeFromImage(joint, true); } - catch (Exception) + catch (Exception e) { - m_log.Error("[DYNAMICTEXTUREMODULE]: OpenJpeg Encode Failed. Empty byte data returned!"); + m_log.ErrorFormat( + "[DYNAMICTEXTUREMODULE]: OpenJpeg Encode Failed. Exception {0}{1}", + e.Message, e.StackTrace); } return result; diff --git a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs index 7316e5b546..c061868ed6 100644 --- a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs @@ -338,10 +338,11 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender { imageJ2000 = OpenJPEG.EncodeFromImage(bitmap, true); } - catch (Exception) + catch (Exception e) { - m_log.Error( - "[VECTORRENDERMODULE]: OpenJpeg Encode Failed. Empty byte data returned!"); + m_log.ErrorFormat( + "[VECTORRENDERMODULE]: OpenJpeg Encode Failed. Exception {0}{1}", + e.Message, e.StackTrace); } m_textureManager.ReturnData(id, imageJ2000);