changeset 2935:aeeb40a35ce1

/image-uint16: return 404 instead of unsupported.png when instance is not found
author am@osimis.io
date Wed, 28 Nov 2018 14:34:56 +0100
parents 00504dcc996f
children 4b3929668358
files OrthancServer/OrthancRestApi/OrthancRestResources.cpp
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancServer/OrthancRestApi/OrthancRestResources.cpp	Thu Nov 15 11:35:35 2018 +0100
+++ b/OrthancServer/OrthancRestApi/OrthancRestResources.cpp	Wed Nov 28 14:34:56 2018 +0100
@@ -529,7 +529,7 @@
     }
     catch (OrthancException& e)
     {
-      if (e.GetErrorCode() == ErrorCode_ParameterOutOfRange)
+      if (e.GetErrorCode() == ErrorCode_ParameterOutOfRange || e.GetErrorCode() == ErrorCode_UnknownResource)
       {
         // The frame number is out of the range for this DICOM
         // instance, the resource is not existent
@@ -544,6 +544,7 @@
 
         call.GetOutput().Redirect(root + "app/images/unsupported.png");
       }
+      return;
     }
 
     ImageToEncode image(decoded, mode, invert);