bug #7241
closedMissing rights are not correctly indicated in Vaadin distribution editor - flexible vaadin errorhandler is needed
70%
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
Updated by Andreas Müller about 5 years ago
- Target version changed from Unassigned CDM tickets to Release 4.14
Updated by Andreas Kohlbecker about 5 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.
Updated by Andreas Müller about 5 years ago
- Target version changed from Release 4.14 to Release 5.0
Updated by Fabian Reimeier about 5 years ago
- Status changed from New to In Progress
- % Done changed from 0 to 70
Updated by Fabian Reimeier about 5 years ago
- Status changed from In Progress to Resolved
- Assignee changed from Fabian Reimeier to Andreas Müller
Updated by Andreas Kohlbecker about 5 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.
Updated by Fabian Reimeier almost 5 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.
Updated by Andreas Kohlbecker almost 5 years ago
- Status changed from Resolved to Closed
Updated by Andreas Kohlbecker about 4 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