[BitBucket user: Alain Mazy] [BitBucket date: 2017-11-10.16:52:32] - When trying to store a study that does not exist, we get a 500 response - When trying to store a study that exists to a modalityId that does not exist, we get a 500 response. In both cases, we should get a 404 and eventually a detail telling us what is not found.
[BitBucket user: Sébastien Jodogne] [BitBucket date: 2019-01-25.09:24:48] The second part of this issue (storing an existing study to an inexistent modality, in this case "nope") is solved since at least Orthanc 1.0.0 . ```text $ sudo docker run -p 4242:4242 -p 8042:8042 --rm jodogne/orthanc:1.5.2 $ curl -u orthanc:orthanc http://localhost:8042/modalities/nope/store -X POST -d '19816330-cb02e1cf-df3a8fe8-bf510623-ccefe9f5' -i HTTP/1.1 404 Not Found Connection: keep-alive Content-Length: 293 { "Details" : "No modality with symbolic name: nope", "HttpError" : "Not Found", "HttpStatus" : 404, "Message" : "Accessing an inexistent item", "Method" : "POST", "OrthancError" : "Accessing an inexistent item", "OrthancStatus" : 7, "Uri" : "/modalities/nope/store" } ```
[BitBucket user: Sébastien Jodogne] [BitBucket date: 2019-01-25.12:10:57] Fix issue #73 (/modalities/{modalityId}/store raises 500 errors instead of 404) → https://hg.orthanc-server.com/orthanc/changeset/860aed8258c3
[BitBucket user: Sébastien Jodogne] [BitBucket date: 2019-01-25.12:15:57] This issue was essentially a missing description of the error message. This is now fixed: ```text # Test with a invalid Orthanc identifier (results in a 400 error without body in Orthanc <= 1.5.2): $ curl http://localhost:8042/modalities/self/store -X POST -d '["19816330-cb02e1cf-df3a8fe8-bf510623-ccefe9f"]' -i HTTP/1.1 400 Bad Request Connection: keep-alive Content-Length: 324 { "Details" : "This string is not a valid Orthanc identifier: 19816330-cb02e1cf-df3a8fe8-bf510623-ccefe9f", "HttpError" : "Bad Request", "HttpStatus" : 400, "Message" : "Bad file format", "Method" : "POST", "OrthancError" : "Bad file format", "OrthancStatus" : 15, "Uri" : "/modalities/self/store" } # Test with a valid Orthanc identifier, but nonexistent DICOM instance: $ curl http://localhost:8042/modalities/self/store -X POST -d '["19816330-cb02e1cf-df3a8fe8-bf510623-ccefe9f6"]' -i HTTP/1.1 404 Not Found Connection: keep-alive Content-Length: 215 { "HttpError" : "Not Found", "HttpStatus" : 404, "Message" : "Unknown resource", "Method" : "POST", "OrthancError" : "Unknown resource", "OrthancStatus" : 17, "Uri" : "/modalities/self/store" } ```