chore: Update termination/exception handling

This commit is contained in:
Magnus Leßmann (@MarkL4YG) 2024-11-23 13:41:30 +01:00
parent f6eacd4d6d
commit 861b7469d2
2 changed files with 57 additions and 50 deletions

View file

@ -32,9 +32,6 @@ public class CertificateCreationService {
) {
certificate.setPrivateKey(Files.readAllBytes(certificateCreatorResult.certificateKeyPath()));
certificate.setCert(Files.readAllBytes(certificateCreatorResult.certificatePath()));
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new IllegalStateException("Interrupted exception", e);
} catch (CommandLineOperationException | IOException e) {
throw new IllegalStateException("Failed to create certificate!", e);
}
@ -81,8 +78,6 @@ public class CertificateCreationService {
return certificateRepository.save(entity);
} catch (CommandLineOperationException | IOException e) {
throw new RuntimeException("Unable to import certificate", e);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}