comparison Plugins/Engine/PluginsManager.cpp @ 2884:497a637366b4 db-changes

integration mainline->db-changes
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 12 Oct 2018 15:18:10 +0200
parents be5c0f4155f6
children 4e43e67f8ecf
comparison
equal deleted inserted replaced
1762:2b91363cc1d1 2884:497a637366b4
1 /** 1 /**
2 * Orthanc - A Lightweight, RESTful DICOM Store 2 * Orthanc - A Lightweight, RESTful DICOM Store
3 * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics 3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
4 * Department, University Hospital of Liege, Belgium 4 * Department, University Hospital of Liege, Belgium
5 * Copyright (C) 2017-2018 Osimis S.A., Belgium
5 * 6 *
6 * This program is free software: you can redistribute it and/or 7 * This program is free software: you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as 8 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation, either version 3 of the 9 * published by the Free Software Foundation, either version 3 of the
9 * License, or (at your option) any later version. 10 * License, or (at your option) any later version.
31 32
32 33
33 #include "../../OrthancServer/PrecompiledHeadersServer.h" 34 #include "../../OrthancServer/PrecompiledHeadersServer.h"
34 #include "PluginsManager.h" 35 #include "PluginsManager.h"
35 36
36 #if ORTHANC_PLUGINS_ENABLED != 1 37 #if ORTHANC_ENABLE_PLUGINS != 1
37 #error The plugin support is disabled 38 #error The plugin support is disabled
38 #endif 39 #endif
39 40
40
41 #include "../../Core/Toolbox.h"
42 #include "../../Core/HttpServer/HttpOutput.h" 41 #include "../../Core/HttpServer/HttpOutput.h"
43 #include "../../Core/Logging.h" 42 #include "../../Core/Logging.h"
43 #include "../../Core/OrthancException.h"
44 #include "../../Core/Toolbox.h"
44 45
45 #include <cassert> 46 #include <cassert>
46 #include <memory> 47 #include <memory>
47 #include <boost/filesystem.hpp> 48 #include <boost/filesystem.hpp>
48 49
49 #ifdef WIN32 50 #ifdef WIN32
50 #define PLUGIN_EXTENSION ".dll" 51 #define PLUGIN_EXTENSION ".dll"
51 #elif defined(__linux) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__) 52 #elif defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__) || defined(__OpenBSD__)
52 #define PLUGIN_EXTENSION ".so" 53 #define PLUGIN_EXTENSION ".so"
53 #elif defined(__APPLE__) && defined(__MACH__) 54 #elif defined(__APPLE__) && defined(__MACH__)
54 #define PLUGIN_EXTENSION ".dylib" 55 #define PLUGIN_EXTENSION ".dylib"
55 #else 56 #else
56 #error Support your platform here 57 #error Support your platform here
189 } 190 }
190 } 191 }
191 catch (OrthancException& e) 192 catch (OrthancException& e)
192 { 193 {
193 // This service provider has failed 194 // This service provider has failed
194 LOG(ERROR) << "Exception while invoking plugin service " << service << ": " << e.What(); 195 if (e.GetErrorCode() != ErrorCode_UnknownResource) // This error code is valid in plugins
196 {
197 LOG(ERROR) << "Exception while invoking plugin service " << service << ": " << e.What();
198 }
199
195 return static_cast<OrthancPluginErrorCode>(e.GetErrorCode()); 200 return static_cast<OrthancPluginErrorCode>(e.GetErrorCode());
196 } 201 }
197 } 202 }
198 203
199 LOG(ERROR) << "Plugin invoking unknown service: " << service; 204 LOG(ERROR) << "Plugin invoking unknown service: " << service;