Project

General

Profile

Actions

bug #7241

closed

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

Added by Andreas Müller about 6 years ago. Updated about 5 years ago.

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

70%

Estimated time:
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.


Files

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

Updated by Andreas Müller about 6 years ago

  • Target version changed from Unassigned CDM tickets to Release 4.14
Actions #2

Updated by Andreas Kohlbecker about 6 years 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.

Actions #3

Updated by Andreas Müller about 6 years ago

  • Target version changed from Release 4.14 to Release 5.0
Actions #4

Updated by Fabian Reimeier about 6 years ago

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

Updated by Fabian Reimeier about 6 years ago

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

Updated by Andreas Kohlbecker about 6 years 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.

Actions #7

Updated by Fabian Reimeier about 6 years 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.

Actions #8

Updated by Andreas Kohlbecker about 6 years ago

  • Status changed from Resolved to Closed
Actions #9

Updated by Andreas Kohlbecker about 5 years 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
Actions

Also available in: Atom PDF