How to add exception handling?

I have been working on a project which involves sending HTTP request. I want to add Exception handling when the HTTP request fails. How do I go about adding it? I tried adding try{}catch(){}, but getting an error saying exception handling disabled, please use -fexceptions to enable

Any help on the same will be appreciated.

Which HTTP call are you using? Is it capable to generate an exception?

Either way, I am afraid the exception handling may be too much for an embedded system memory, so this may be the reason why it is disabled.

OK. I’ll try not to use.