Exception handling in OAF
There are 3 types of exceptions can be thrown on OAF
pages (java).
a)Warning :
This will display the custom message and no effect in the oaf page execution
b)Information
: This will display the custom message and no effect in the oaf page
execution
c)Error : This will display the custom message and
has effect in the oaf page execution.
It stops the page execution by throwing message as a
exception
Exception handling in paf page has done through Try and
catch block syntax.
Try Block :- All logic should be kept in a try block
to handle exceptions.
In this block we do all our coding part , so that if
any exception raised in the logic or cading part then it will be handled through
catch block.
Catch Block – Once control find any exception in the
try block, it goes to catch block. Catch block will be used to handle the
raised exception.
throw new oaexception syntax
for Example -
try{
custom code
{
}
// For
Warning Message
throw new
OAException("Exception " +e, OAException.WARNING);
// For
Information Message
throw new
OAException("Exception " +e,
OAException.INFORMATION);
// For Error
Message
throw new OAException("Exception " +e, OAException.ERROR);
If exception occurs in custom code, control will
come to catch block and it will print the relative exception message on the
screen.
Exception handling in OAF
0 comments:
Post a Comment