File tree 2 files changed +11
-6
lines changed
server/http-api/src/main/java/cc/blynk/server/api/http/logic
2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 27
27
<module >integration-tests</module >
28
28
</modules >
29
29
30
+ <!-- for QR gen tool -->
31
+ <repositories >
32
+ <repository >
33
+ <id >jitpack.io</id >
34
+ <url >https://jitpack.io</url >
35
+ </repository >
36
+ </repositories >
37
+
30
38
<build >
31
39
<plugins >
32
40
<plugin >
36
44
<configuration >
37
45
<source >1.8</source >
38
46
<target >1.8</target >
39
- <!-- this is to avoid travis build failure on old machines with JDK bugs -->
40
- <useIncrementalCompilation >false</useIncrementalCompilation >
41
47
</configuration >
42
48
</plugin >
43
49
104
110
<commons-validator .version>1.5.0</commons-validator .version>
105
111
<postgresql .version>9.4.1208</postgresql .version>
106
112
<HikariCP .version>2.4.7</HikariCP .version>
107
- <qrgen .version>2.1 .0</qrgen .version>
113
+ <qrgen .version>2.2 .0</qrgen .version>
108
114
109
115
<!-- test versions -->
110
116
<commons-lang3 .version>3.4</commons-lang3 .version>
Original file line number Diff line number Diff line change 39
39
40
40
import javax .ws .rs .*;
41
41
import javax .ws .rs .core .MediaType ;
42
- import java .io .IOException ;
43
42
import java .util .Base64 ;
44
43
45
44
import static cc .blynk .core .http .Response .*;
@@ -228,8 +227,8 @@ public Response updateWidgetPinData(@PathParam("token") String token) {
228
227
String qrData = "bp1" + Base64 .getEncoder ().encodeToString (compressed );
229
228
byte [] qrDataBinary = QRCode .from (qrData ).to (ImageType .PNG ).withSize (500 , 500 ).stream ().toByteArray ();
230
229
return ok (qrDataBinary , "image/png" );
231
- } catch (IOException ioe ) {
232
- log .error ("Error generating QR." , ioe );
230
+ } catch (Exception e ) {
231
+ log .error ("Error generating QR. Reason : {} " , e . getMessage () );
233
232
return Response .badRequest ("Error generating QR." );
234
233
}
235
234
}
You can’t perform that action at this time.
0 commit comments