diff --git a/powerauth-admin/src/main/java/io/getlime/security/app/admin/util/QRUtil.java b/powerauth-admin/src/main/java/io/getlime/security/app/admin/util/QRUtil.java index cf6d2fdf9..063d74aee 100644 --- a/powerauth-admin/src/main/java/io/getlime/security/app/admin/util/QRUtil.java +++ b/powerauth-admin/src/main/java/io/getlime/security/app/admin/util/QRUtil.java @@ -21,6 +21,7 @@ import com.google.zxing.WriterException; import com.google.zxing.client.j2se.MatrixToImageWriter; import com.google.zxing.common.BitMatrix; +import lombok.extern.slf4j.Slf4j; import javax.imageio.ImageIO; import java.awt.image.BufferedImage; @@ -34,8 +35,13 @@ * * @author Petr Dvorak */ +@Slf4j public class QRUtil { + private QRUtil() { + throw new IllegalStateException("Should not be instantiated"); + } + /** * Encode the string data into a QR code of a given size (size = width = height) * and return the result as "data:" URL. @@ -57,7 +63,7 @@ public static String encode(String qrCodeData, int qrCodeSize) { byte[] bytes = baos.toByteArray(); return "data:image/png;base64," + Base64.getEncoder().encodeToString(bytes); } catch (WriterException | IOException e) { - e.printStackTrace(); + logger.warn("Problem to encode the string data into a QR code", e); } return null; }