class DefaultWorkbenchErrorCallback {

    public static boolean isKieServerForbiddenException(final Throwable throwable) {
        if (throwable instanceof KieServicesHttpException && ((KieServicesHttpException) throwable).getHttpCode() == 403) {
            return true;
        }
        //Cause type isn't propagated, manually checking the message content
        //Expect to get a string like: 'Unexpected HTTP response code when requesting URI ''! Error code: 403, message: <html><head><title>Error</title></head><body>Forbidden</body></html>'
        if (throwable instanceof DataSetLookupException && (throwable.getCause() != null && throwable.getCause().getMessage().contains("Error code: 403"))) {
            return true;
        }
        return false;
    }

}