You need to sign in to do that
Don't have an account?

try-catch block covering complte code of method
Hii All,
I have a query that should we apply try - catch block in complete method ciovering all lines or only for those that generate exceptions like DML statements.
my concern that what we want that our functionalty should not break any where , in case any exception occurs (any kind) it should be in message format. But issue is it will create problem in test classes as trst classes also nit fails due to exception handling and it will be difficult to find out for test coverage.
please let me know your thoughts.
I have a query that should we apply try - catch block in complete method ciovering all lines or only for those that generate exceptions like DML statements.
my concern that what we want that our functionalty should not break any where , in case any exception occurs (any kind) it should be in message format. But issue is it will create problem in test classes as trst classes also nit fails due to exception handling and it will be difficult to find out for test coverage.
please let me know your thoughts.
Class example
Test example
More information: http://pcon.github.io/presentations/testing/#exceptional-unknown-class-pre