Skip to content

Instantly share code, notes, and snippets.

@schmir
Created June 9, 2011 15:34
Show Gist options
  • Save schmir/1016993 to your computer and use it in GitHub Desktop.
Save schmir/1016993 to your computer and use it in GitHub Desktop.
#include <exception>
#include <iostream>
class fopen_failed: public std::exception
{
public:
const char *what() const throw() {
return "fopen failed";
}
};
int main()
{
try {
throw fopen_failed();
} catch (...) {
};
std::cout << "good\n";
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment