Here I am trying to display a error message when relation does not exist then exception occurred.
Example:
Create or replace function fun_test() returns void as
$$
Begin
Truncate testtb;
Exception
When does_not_exist then /* When testtb does not exist*/
raise info 'Relation does not exists';
...
ERROR: unrecognized exception condition "does_not_exist"