Skip to content

Exception issues on OSX #48

Closed
Closed
@dbertrand402

Description

@dbertrand402

CPPRest compiled on OSX exhibits a problem catching exceptions properly :

try
  {
    json::value::parse("some badly formatted JSON");
  }
  catch( const json::json_exception& e )
  {
    cout << "json::json_exception caught" << endl;
  }
  catch( const std::exception& e )
  {
    cout << "std::exception caught" << endl;
  }

Following code displays "std::exception caught" on OSX. This really should display "json::json_exception caught", instead. I suspect this is caused by known Apple GCC issue when shared libraries are not built using RTTI. See following StackOverflow article :

Polymorphically catching an exception in a -fno-rtti shared library on Mac OS X

(CPPRest 2.6.0, OSX Yosemite, XCode 6.4)

CPPRest issue repro.zip

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions