]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/geometry/srs/projections/exception.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / geometry / srs / projections / exception.hpp
index 222207024e94bf0ff362fb60aff1c8a16011883f..c96ee005a5a9eaadae4719be7d4dfaf35db908d3 100644 (file)
@@ -2,8 +2,8 @@
 
 // Copyright (c) 2008-2012 Barend Gehrels, Amsterdam, the Netherlands.
 
-// This file was modified by Oracle on 2017.
-// Modifications copyright (c) 2017, Oracle and/or its affiliates.
+// This file was modified by Oracle on 2017, 2018.
+// Modifications copyright (c) 2017-2018, Oracle and/or its affiliates.
 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
 
 // Use, modification and distribution is subject to the Boost Software License,
@@ -60,29 +60,45 @@ struct projection_not_named_exception
     : projection_exception
 {
     projection_not_named_exception()
-        : projection_exception(-4)
+        : projection_exception(projections::detail::error_proj_not_named)
     {}
 };
 
 struct projection_unknown_id_exception
     : projection_exception
 {
+    projection_unknown_id_exception()
+        : projection_exception(projections::detail::error_unknown_projection_id,
+                               msg())
+    {}
+
     projection_unknown_id_exception(std::string const& proj_name)
-        : projection_exception(-5, msg(proj_name))
+        : projection_exception(projections::detail::error_unknown_projection_id,
+                               msg(proj_name))
     {}
 
 private:
+    static std::string msg()
+    {
+        using namespace projections::detail;
+        return pj_strerrno(error_unknown_projection_id);
+    }
     static std::string msg(std::string const& proj_name)
     {
-        return projections::detail::pj_strerrno(-5) + " (" + proj_name + ")";
+        using namespace projections::detail;
+        return pj_strerrno(error_unknown_projection_id) + " (" + proj_name + ")";
     }
 };
 
 struct projection_not_invertible_exception
     : projection_exception
 {
+    // NOTE: There is no error code in proj4 which could be used here
+    // Proj4 sets points as invalid (HUGE_VAL) and last errno to EINVAL
+    // in pj_inv() if inverse projection is not available.
     projection_not_invertible_exception(std::string const& proj_name)
-        : projection_exception(-17, msg(proj_name))
+        : projection_exception(projections::detail::error_non_conv_inv_meri_dist,
+                               msg(proj_name))
     {}
 
 private: