Hello Experts,
I'm using JDev 11.1.1.7.0
In one of my Database table i have a unique key constraint.
When the UK is violated it shows this message to the user:

As you can see it doesn't look very nice.
I want to make it look better than this and not to share too much info with the user.
The page that displays this error is a page Fragment from a TF that is used as a region in the mainPage.
I tried creating a DCErrorHandlerImpl extended class following this tutorial: ADF: Custom Error Handler to Display Custom Message to User | ADF Tutorials
But it still displays the same message.
This is the class i created:
import oracle.adf.model.binding.DCBindingContainer;
import oracle.adf.model.binding.DCErrorHandlerImpl;
import java.sql.SQLException;
import oracle.adf.model.BindingContext;
import oracle.adf.model.binding.DCBindingContainer;
import oracle.adf.model.binding.DCErrorHandlerImpl;
import oracle.jbo.JboException;
public class MyCustomErrorHandler extends DCErrorHandlerImpl {
public MyCustomErrorHandler() {
this(true);
}
public MyCustomErrorHandler(boolean setToThrow) {
super(setToThrow);
}
@Override
public void reportException(DCBindingContainer dCBindingContainer,Exception exception) {
super.reportException(dCBindingContainer, exception);
}
public String getDisplayMessage(BindingContext ctx, Exception ex) {
String message="";
if (ex instanceof oracle.jbo.ValidationException) {
String msg = ex.getMessage();
int i=msg.indexOf("JBO-26048");//When JBO-26048 UK Constraint Violated.
if(i>0) {
message= "Duplicate Product Entry Detected.";
}
message= getDisplayMessage(ctx,ex);
} else {
message=getDisplayMessage(ctx,ex);
}
return message;
}
}
What did i do wrong?
Thank you for your time
Gado