Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mention bean's order in Client-Level Exception Handlers #719

Open
glebshalyganov opened this issue Jul 2, 2020 · 0 comments
Open

Mention bean's order in Client-Level Exception Handlers #719

glebshalyganov opened this issue Jul 2, 2020 · 0 comments
Assignees
Labels
type: bug Something isn't working
Milestone

Comments

@glebshalyganov
Copy link

glebshalyganov commented Jul 2, 2020

Mention that custom Client-Level Exception Handlers should implement Spring’s Ordered interface or contain the Order annotation to override handlers defined in the platform. Similar explanation presents here (in the last paragraph).

Every code sample of a class with the @Component annotation should be extended with the @Order annotation. For example:

package com.company.demo.web;

import com.haulmont.cuba.gui.Notifications;
import com.haulmont.cuba.gui.exception.AbstractUiExceptionHandler;
import org.springframework.stereotype.Component;
import javax.annotation.Nullable;

@Component("demo_ZeroBalanceExceptionHandler")
public class ZeroBalanceExceptionHandler extends AbstractUiExceptionHandler {

    public ZeroBalanceExceptionHandler() {
        super(ZeroBalanceException.class.getName());
    }
....

should be changed to:

package com.company.demo.web;

import com.haulmont.cuba.gui.Notifications;
import com.haulmont.cuba.gui.exception.AbstractUiExceptionHandler;
import org.springframework.stereotype.Component;
import org.springframework.core.annotation.Order;
import javax.annotation.Nullable;

@Component("demo_ZeroBalanceExceptionHandler")
@Order(UiExceptionHandler.HIGHEST_PLATFORM_PRECEDENCE - 10)
public class ZeroBalanceExceptionHandler extends AbstractUiExceptionHandler {

    public ZeroBalanceExceptionHandler() {
        super(ZeroBalanceException.class.getName());
    }
....

Environment

@glebshalyganov glebshalyganov added the type: bug Something isn't working label Jul 2, 2020
@knstvk knstvk self-assigned this Jul 2, 2020
@knstvk knstvk added this to the Doc 7.2 milestone Jul 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants