Hi Yogesh,
you already got the code snippets you are looking for on your computer.
Simply open the online help in SAP HANA studio (press F1) and search for "Exception Handling Examples".
That will take you directly (or after a one time indexing run if you never opened the online help before) to the example coding you requested.
- Lars