diff --git a/java_console/shared_ui/src/com/rusefi/tools/online/Online.java b/java_console/shared_ui/src/com/rusefi/tools/online/Online.java index 496227ed64..dcfda708e9 100644 --- a/java_console/shared_ui/src/com/rusefi/tools/online/Online.java +++ b/java_console/shared_ui/src/com/rusefi/tools/online/Online.java @@ -29,10 +29,11 @@ public class Online { * blocking call for http file upload */ public static UploadResult upload(File fileName, String authTokenValue) { - try { - HttpClient httpclient = new DefaultHttpClient(); - HttpPost httpPost = new HttpPost(url); + HttpClient httpclient = new DefaultHttpClient(); + HttpPost httpPost = new HttpPost(url); + String responseString; + try { FileBody uploadFilePart = new FileBody(fileName); MultipartEntity reqEntity = new MultipartEntity(); reqEntity.addPart("upload-file", uploadFilePart); @@ -43,8 +44,14 @@ public class Online { HttpResponse response = httpclient.execute(httpPost); System.out.println("response=" + response); System.out.println("code " + response.getStatusLine().getStatusCode()); + responseString = HttpUtil.getResponse(response); - JSONObject object = HttpUtil.getJsonResponse(HttpUtil.getResponse(response)); + } catch (IOException e) { + return new UploadResult(true, "Upload io ERROR " + e); + } + + try { + JSONObject object = HttpUtil.getJsonResponse(responseString); System.out.println("object=" + object); JSONArray info = (JSONArray) object.get("info"); @@ -57,8 +64,8 @@ public class Online { return new UploadResult(false, info); } - } catch (IOException | ParseException e) { - return new UploadResult(true, "Error " + e); + } catch (ParseException e) { + return new UploadResult(true, "Upload Error " + responseString); } } diff --git a/java_tools/ts_plugin/src/main/java/com/rusefi/ts_plugin/PluginEntry.java b/java_tools/ts_plugin/src/main/java/com/rusefi/ts_plugin/PluginEntry.java index ce18825073..72a68ec1cb 100644 --- a/java_tools/ts_plugin/src/main/java/com/rusefi/ts_plugin/PluginEntry.java +++ b/java_tools/ts_plugin/src/main/java/com/rusefi/ts_plugin/PluginEntry.java @@ -35,7 +35,8 @@ public class PluginEntry implements TsPluginBody { System.out.println("PluginEntry init " + this); if (isLauncherTooOld()) { - content.add(new JLabel("Please manually install latest plugin version")); + content.add(new JLabel("Please manually install latest plugin version
Usually we can update to latest version but this time there was a major change.
" + + "Please use TunerStudio controls to update to plugin from recent rusEFI bundle.")); return; }