// AhmedWafaa Typing


#include <iostream>

using namespace std;

void errordetection(){
	
	bool error = true;
	
	if(error){
		throw string("oops something went wrong");
	}
	
	bool error2 = true;
	
	if(error2) {
		throw  5;
	}
}

int main() {
	
	try {
		errordetection();
	}
	catch(string &e) {
		cout << e << endl;
	}
	catch(int e) {
		cout << e << endl;
	}
		
	
	return 0;
}

Leave a comment

Your email address will not be published. Required fields are marked *