changeset 1584:39ecd34fb1c7

fix standalone build
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 25 Aug 2015 17:59:04 +0200
parents 9ea3d082b064
children 9a3e03d6a4d5
files Resources/EmbedResources.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Resources/EmbedResources.py	Tue Aug 25 17:52:50 2015 +0200
+++ b/Resources/EmbedResources.py	Tue Aug 25 17:59:04 2015 +0200
@@ -40,6 +40,7 @@
 USE_SYSTEM_EXCEPTION = False
 EXCEPTION_CLASS = 'OrthancException'
 OUT_OF_RANGE_EXCEPTION = 'OrthancException(ErrorCode_ParameterOutOfRange)'
+INEXISTENT_PATH_EXCEPTION = 'OrthancException(ErrorCode_InexistentItem)'
 NAMESPACE = 'Orthanc'
 
 ARGS = []
@@ -52,6 +53,7 @@
         USE_SYSTEM_EXCEPTION = True
         EXCEPTION_CLASS = '::std::runtime_error'
         OUT_OF_RANGE_EXCEPTION = '%s("Parameter out of range")' % EXCEPTION_CLASS
+        INEXISTENT_PATH_EXCEPTION = '%s("Unknown path in a directory resource")' % EXCEPTION_CLASS
     elif sys.argv[i].startswith('--namespace='):
         NAMESPACE = sys.argv[i][sys.argv[i].find('=') + 1 : ]
 
@@ -338,7 +340,7 @@
         for path in resources[name]['Files']:
             cpp.write('        if (!strcmp(path, "%s"))\n' % path)
             cpp.write('          return resource%dBuffer;\n' % resources[name]['Files'][path]['Index'])
-        cpp.write('        throw %s("Unknown path in a directory resource");\n\n' % EXCEPTION_CLASS)
+        cpp.write('        throw %s;\n\n' % INEXISTENT_PATH_EXCEPTION)
 
 cpp.write("""      default:
         throw %s;
@@ -358,7 +360,7 @@
         for path in resources[name]['Files']:
             cpp.write('        if (!strcmp(path, "%s"))\n' % path)
             cpp.write('          return resource%dSize;\n' % resources[name]['Files'][path]['Index'])
-        cpp.write('        throw %s("Unknown path in a directory resource");\n\n' % EXCEPTION_CLASS)
+        cpp.write('        throw %s;\n\n' % INEXISTENT_PATH_EXCEPTION)
 
 cpp.write("""      default:
         throw %s;