Catch CommitException outside of CommitHandler

Hi there,

where can I catch the thrown commit exception from my own CommitHandler?
grid.getEditorFieldGroup().addCommitHandler(new CommitHandler() {
public void preCommit(CommitEvent commitEvent) throws CommitException {

        public void postCommit(CommitEvent commitEvent) throws CommitException {
            // validations...
            boolean failed = true;
            if (failed) {
                // the message I want to display as a notification
                throw new CommitException("Commit failed...");

Right now it shows the error indicator on the grid but I just want to show my own Notification. Any hints?

Thanks in advance!

Can somebody please help me on that one? It’s probably obvious but I can’t figure out how to catch my own thrown CommitException outside of the commit handler… or is it maybe just the wrong approach?

Any help would be greatly appreciated!

I’m one step further… I just found out about the EditorErrorHandler.

setEditorErrorHandler(new EditorErrorHandler() { @Override public void commitError(CommitErrorEvent inEvent) { //inEvent.getUserErrorMessage(); } }); This works, but I can’t seem to transmit my own message in the CommitException (thrown inside the void postCommit())… it always uses the “Commit failed” message from the FieldGroup.class.
Do I really need to override the commit() function and thus build my own FieldGroup or is there an easier way?

  public void commit() throws CommitException {
        if (!isBuffered()) {
            // Not using buffered mode, nothing to do


        try {

            Map<Field<?>, InvalidValueException> invalidValueExceptions = commitFields();

            if (invalidValueExceptions.isEmpty()) {
            } else {
                throw new FieldGroupInvalidValueException(
        } catch (Exception e) {
            throw new CommitException("Commit failed", this, e);