1919%include <std_vector.i>
2020%include <std_shared_ptr.i>
2121
22+ %include <exception.i>
23+
2224%include <pycontainer.swg>
2325
2426namespace web {
@@ -27,7 +29,6 @@ namespace web {
2729 }
2830}
2931
30-
3132SHAREDPTR (odata::edm::edm_named_type)
3233SHAREDPTR(odata::edm::edm_primitive_type)
3334SHAREDPTR(odata::edm::edm_property_type)
@@ -113,6 +114,20 @@ namespace odata {
113114%include " odata/communication/http_communication.h"
114115
115116%include " odata/client/odata_client_options.h"
117+
118+ %exception odata::client::odata_client::send_data_to_server {
119+ try {
120+ $action
121+ } catch (odata::communication::service_exception &e) {
122+ std::string msg = utility::conversions::scan_string (e.what ());
123+ SWIG_exception (SWIG_RuntimeError, msg.c_str ());
124+ } catch (std::invalid_argument &e) {
125+ SWIG_exception (SWIG_AttributeError, e.what ());
126+ } catch (std::exception &e) {
127+ SWIG_exception (SWIG_RuntimeError, e.what ());
128+ }
129+ }
130+
116131%include " odata/client/odata_client.h"
117132
118133%extend odata::edm::edm_entity_container {
@@ -186,10 +201,21 @@ namespace pplx {
186201 template <class _ReturnType >
187202 class task {
188203 public:
189- _ReturnType get () const throw(odata::communication::service_exception) ;
204+ _ReturnType get () const ;
190205 };
191206}
192207
208+ %exception pplx::task::get {
209+ try {
210+ $action
211+ } catch (odata::communication::service_exception &e) {
212+ std::string msg = utility::conversions::scan_string (e.what ());
213+ SWIG_exception (SWIG_RuntimeError, msg.c_str ());
214+ } catch (std::exception &e) {
215+ SWIG_exception (SWIG_RuntimeError, e.what ());
216+ }
217+ }
218+
193219%template (task_edm_model) pplx::task< std::shared_ptr< ::odata::edm::edm_model > >;
194220%template (task_odata_entity_values) pplx::task< std::vector< std::shared_ptr< ::odata::core::odata_entity_value > > >;
195221%template (task_odata_values) pplx::task< std::vector< std::shared_ptr< ::odata::core::odata_value > > >;
0 commit comments