Projekt

Obecné

Profil

« Předchozí | Další » 

Revize c62151d4

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

Improved InvalidSubjectAttribute string representation and added an "except" block in CertificateController that handles this error.

Zobrazit rozdíly:

src/controllers/certificates_controller.py
15 15
from src.model.subject import Subject
16 16
from src.services.certificate_service import CertificateService, RevocationReasonInvalidException, \
17 17
    CertificateStatusInvalidException, CertificateNotFoundException, CertificateAlreadyRevokedException, \
18
    CertificateCannotBeSetToValid
18
    CertificateCannotBeSetToValid, InvalidSubjectAttribute
19 19
#  responsibility.
20 20
from src.services.cryptography import CryptographyException
21 21
from src.services.key_service import KeyService
......
200 200
                    return E_INVALID_EXTENSIONS, C_BAD_REQUEST
201 201
                else:
202 202
                    raise CryptographyException(e.executable, e.args, e.message)
203
            except InvalidSubjectAttribute as e:
204
                return {"success": False, "data": str(e)}, C_BAD_REQUEST
203 205

  
204 206
            if cert is not None:
205 207
                return {"success": True,

Také k dispozici: Unified diff