comparison Plugins/Engine/OrthancPlugins.cpp @ 3404:e280ced38a4c

ErrorCode_UnsupportedMediaType
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 07 Jun 2019 18:43:42 +0200
parents 962e5f00744b
children b7728227a852
comparison
equal deleted inserted replaced
3403:630fc934597f 3404:e280ced38a4c
4245 LOG(INFO) << "Invalid Content-Type HTTP header, " 4245 LOG(INFO) << "Invalid Content-Type HTTP header, "
4246 << "prevents streaming the body: \"" << multipartContentType << "\""; 4246 << "prevents streaming the body: \"" << multipartContentType << "\"";
4247 continue; 4247 continue;
4248 } 4248 }
4249 4249
4250 OrthancPluginErrorCode errorCode = OrthancPluginErrorCode_Plugin;
4251
4250 OrthancPluginMultipartRestHandler* handler = (*it)->GetParameters().createHandler( 4252 OrthancPluginMultipartRestHandler* handler = (*it)->GetParameters().createHandler(
4251 (*it)->GetParameters().factory, 4253 (*it)->GetParameters().factory, &errorCode,
4252 convertedMethod, matcher.GetFlatUri().c_str(), contentType.c_str(), subType.c_str(), 4254 convertedMethod, matcher.GetFlatUri().c_str(), contentType.c_str(), subType.c_str(),
4253 matcher.GetGroupsCount(), matcher.GetGroups(), headers.size(), 4255 matcher.GetGroupsCount(), matcher.GetGroups(), headers.size(),
4254 headers.empty() ? NULL : &headersKeys[0], 4256 headers.empty() ? NULL : &headersKeys[0],
4255 headers.empty() ? NULL : &headersValues[0]); 4257 headers.empty() ? NULL : &headersValues[0]);
4256 4258
4257 return new MultipartStream(handler, (*it)->GetParameters(), boundary, GetErrorDictionary()); 4259 if (handler == NULL)
4260 {
4261 if (errorCode == OrthancPluginErrorCode_Success)
4262 {
4263 // Ignore: The factory cannot create a handler for this request
4264 }
4265 else
4266 {
4267 throw OrthancException(static_cast<ErrorCode>(errorCode));
4268 }
4269 }
4270 else
4271 {
4272 return new MultipartStream(handler, (*it)->GetParameters(), boundary, GetErrorDictionary());
4273 }
4258 } 4274 }
4259 } 4275 }
4260 4276
4261 return NULL; 4277 return NULL;
4262 } 4278 }