Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 2166bb21

Přidáno uživatelem Stanislav Král před téměř 4 roky(ů)

Added a global error handler for DatabaseException errors.
Covered the added global DatabaseException error handler in a test.

Zobrazit rozdíly:

app.py
9 9
from src.config.connection_provider import ConnectionProvider
10 10
from src.controllers.certificates_controller import CertController
11 11
from src.controllers.crl_ocsp_controller import CrlOcspController
12
from src.exceptions.database_exception import DatabaseException
12 13
from src.services.cryptography import CryptographyService, CryptographyException
13 14
from src.utils.logger import Logger
14 15

  
......
95 96
    return certificate_controller.handle_cryptography_error(e)
96 97

  
97 98

  
99
@app.errorhandler(DatabaseException)
100
def database_error(e, certificate_controller: CertController):
101
    return certificate_controller.handle_database_error(e)
102

  
103

  
98 104
def initialize_app(application) -> bool:
99 105
    """
100 106
    Initializes the application

Také k dispozici: Unified diff