bug #7241
Missing 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.
Associated revisions
ref #7241 added DelegatingErrorHandler for components
ref #7241 documentation, adding serial ids, fixing logging
ref #7241 DelegatingErrorHandler more generically
ref #7241 documentation, adding serial ids
ref #7241 modifications to use generic DelegatingErrorHandler
History
#1 Updated by Andreas Müller about 3 years ago
- Target version changed from Unassigned CDM tickets to Release 4.14
#2 Updated by Andreas Kohlbecker about 3 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.
#3 Updated by Andreas Müller about 3 years ago
- Target version changed from Release 4.14 to Release 5.0
#4 Updated by Fabian Reimeier about 3 years ago
- Status changed from New to In Progress
- % Done changed from 0 to 70
#5 Updated by Fabian Reimeier about 3 years ago
- Status changed from In Progress to Resolved
- Assignee changed from Fabian Reimeier to Andreas Müller
#6 Updated by Andreas Kohlbecker almost 3 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.
#7 Updated by Fabian Reimeier almost 3 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.
#8 Updated by Andreas Kohlbecker almost 3 years ago
- Status changed from Resolved to Closed
#9 Updated by Andreas Kohlbecker about 2 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