class SessionService {

    public AuthnResponseFromHubContainerDto getRpErrorResponse(SessionId sessionId) {
        getSessionIfItExists(sessionId);
        final ResponseFromHub errorResponseFromHub = authnRequestHandler.getErrorResponseFromHub(sessionId);
        final RequestForErrorResponseFromHubDto requestForErrorResponseFromHubDto =
                new RequestForErrorResponseFromHubDto(errorResponseFromHub.getAuthnRequestIssuerEntityId(),
                        errorResponseFromHub.getResponseId(),
                        errorResponseFromHub.getInResponseTo(),
                        errorResponseFromHub.getAssertionConsumerServiceUri(),
                        errorResponseFromHub.getStatus());
        final SamlMessageDto samlMessageDto = samlEngineProxy.generateErrorResponseFromHub(requestForErrorResponseFromHubDto);
        final AuthnResponseFromHubContainerDto authnResponseFromHubContainerDto =
                new AuthnResponseFromHubContainerDto(samlMessageDto.getSamlMessage(),
                        errorResponseFromHub.getAssertionConsumerServiceUri(),
                        errorResponseFromHub.getRelayState(),
                        errorResponseFromHub.getResponseId());
        return authnResponseFromHubContainerDto;
    }

    @Inject public  SessionService(SamlEngineProxy samlEngineProxy,
                          TransactionsConfigProxy configProxy,
                          AuthnRequestFromTransactionHandler authnRequestHandler,
                          SessionRepository sessionRepository);

}