Project

General

Profile

bug #7241

Missing rights are not correctly indicated in Vaadin distribution editor - flexible vaadin errorhandler is needed

Added by Andreas Müller about 1 year ago. Updated 2 months ago.

Status:
Closed
Priority:
New
Category:
cdm-vaadin
Target version:
Start date:
02/02/2018
Due date:
% Done:

70%

Severity:
normal
Found in Version:

Description

If a user has not enough rights to edit a distribution in the Vaadin Distribution Editor this is only indicated by an ordinary exception. But it should be explained in an explicit error message.

See screenshots.

picture13-1.png View (71.5 KB) Andreas Müller, 02/02/2018 02:58 PM

picture13-2.png View (9.83 KB) Andreas Müller, 02/02/2018 02:58 PM

Associated revisions

Revision efb45d70 (diff)
Added by Fabian Reimeier about 1 year ago

ref #7241 added DelegatingErrorHandler for components

Revision b5d06161 (diff)
Added by Andreas Kohlbecker about 1 year ago

ref #7241 documentation, adding serial ids, fixing logging

Revision 42d326df (diff)
Added by Andreas Kohlbecker about 1 year ago

ref #7241 DelegatingErrorHandler more generically

Revision 21c9f167 (diff)
Added by Andreas Kohlbecker about 1 year ago

ref #7241 documentation, adding serial ids

Revision c7605112 (diff)
Added by Fabian Reimeier about 1 year ago

ref #7241 modifications to use generic DelegatingErrorHandler

History

#1 Updated by Andreas Müller about 1 year ago

  • Target version changed from Unassigned CDM tickets to Release 4.14

#2 Updated by Andreas Kohlbecker about 1 year ago

vaddin allows setting an com.vaadin.server.ErrorHandler for UIs and components. The caveat with this builtin appraoch is that there is only one com.vaadin.server.ErrorHandler for any type of errors. Therefore it would make sense to implement a DelegatingErrorHandler to which handlers for specific types of errors can be registered:


class DelegatingErrorHandler implements ErrorHandler {

 Map<<? extends Exception>, ErrorTypeHandler<? extends Exception>> handlerMap;

 ErrorHandler defaultHandler;

 public void error(ErrorEvent event){

    if(handlerMap.get(type) = null){
      handlerMap.get(type).handleError(
    } else {
       defaultHandler.error(event);
    }

 public <E extends Exception> void registerHandler(Class<E> type, ErrorTypeHandler<E> handler){
    handlerMap.put(type, handler);
 }
}

class abstract ErrorTypeHandler<E extends Exception> implements ErrorHandler {


  public final void error(ErrorEvent event){
     handleError((E)event);
  }

  public abstract void handleError(<E> event);
}

something like this.

#3 Updated by Andreas Müller about 1 year ago

  • Target version changed from Release 4.14 to Release 5.0

#4 Updated by Fabian Reimeier about 1 year ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 70

#5 Updated by Fabian Reimeier about 1 year ago

  • Status changed from In Progress to Resolved
  • Assignee changed from Fabian Reimeier to Andreas Müller

#6 Updated by Andreas Kohlbecker about 1 year ago

  • Assignee changed from Andreas Müller to Fabian Reimeier

I modified the DelegatingErrorHandler and ErrorTypeHandler a bit in order to allow using it generically in more contexts.

@Fabian. Please review my changes and check if everything still works for your UI.

#7 Updated by Fabian Reimeier about 1 year ago

  • Assignee changed from Fabian Reimeier to Andreas Kohlbecker

Andreas Kohlbecker wrote:

I modified the DelegatingErrorHandler and ErrorTypeHandler a bit in order to allow using it generically in more contexts.

@Fabian. Please review my changes and check if everything still works for your UI.

I made some modifications and everything seems to work right now.

#8 Updated by Andreas Kohlbecker about 1 year ago

  • Status changed from Resolved to Closed

#9 Updated by Andreas Kohlbecker 2 months ago

  • Subject changed from Missing rights are not correctly indicated in Vaadin distribution editor to Missing rights are not correctly indicated in Vaadin distribution editor - flexible vaadin errorhandler is needed

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)