Stop suppressing exceptions

This commit is contained in:
Cameron Gutman 2019-01-01 23:31:38 -08:00
parent 0f9cba1053
commit 7e154292a9
8 changed files with 77 additions and 73 deletions

View File

@ -1,5 +1,6 @@
package com.limelight; package com.limelight;
import java.io.IOException;
import java.io.StringReader; import java.io.StringReader;
import java.util.List; import java.util.List;
@ -43,6 +44,8 @@ import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import android.widget.AdapterView.AdapterContextMenuInfo; import android.widget.AdapterView.AdapterContextMenuInfo;
import org.xmlpull.v1.XmlPullParserException;
public class AppView extends Activity implements AdapterFragmentCallbacks { public class AppView extends Activity implements AdapterFragmentCallbacks {
private AppGridAdapter appGridAdapter; private AppGridAdapter appGridAdapter;
private String uuidString; private String uuidString;
@ -214,7 +217,9 @@ public class AppView extends Activity implements AdapterFragmentCallbacks {
blockingLoadSpinner.dismiss(); blockingLoadSpinner.dismiss();
blockingLoadSpinner = null; blockingLoadSpinner = null;
} }
} catch (Exception ignored) {} } catch (XmlPullParserException | IOException e) {
e.printStackTrace();
}
} }
}); });
@ -278,7 +283,7 @@ public class AppView extends Activity implements AdapterFragmentCallbacks {
List<NvApp> applist = NvHTTP.getAppListByReader(new StringReader(lastRawApplist)); List<NvApp> applist = NvHTTP.getAppListByReader(new StringReader(lastRawApplist));
updateUiWithAppList(applist); updateUiWithAppList(applist);
LimeLog.info("Loaded applist from cache"); LimeLog.info("Loaded applist from cache");
} catch (Exception e) { } catch (IOException | XmlPullParserException e) {
if (lastRawApplist != null) { if (lastRawApplist != null) {
LimeLog.warning("Saved applist corrupted: "+lastRawApplist); LimeLog.warning("Saved applist corrupted: "+lastRawApplist);
e.printStackTrace(); e.printStackTrace();

View File

@ -53,6 +53,8 @@ import android.widget.RelativeLayout;
import android.widget.Toast; import android.widget.Toast;
import android.widget.AdapterView.AdapterContextMenuInfo; import android.widget.AdapterView.AdapterContextMenuInfo;
import org.xmlpull.v1.XmlPullParserException;
import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10; import javax.microedition.khronos.opengles.GL10;
@ -420,7 +422,7 @@ public class PcView extends Activity implements AdapterFragmentCallbacks {
message = getResources().getString(R.string.error_unknown_host); message = getResources().getString(R.string.error_unknown_host);
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
message = getResources().getString(R.string.error_404); message = getResources().getString(R.string.error_404);
} catch (Exception e) { } catch (XmlPullParserException | IOException e) {
e.printStackTrace(); e.printStackTrace();
message = e.getMessage(); message = e.getMessage();
} }
@ -521,8 +523,9 @@ public class PcView extends Activity implements AdapterFragmentCallbacks {
message = getResources().getString(R.string.error_unknown_host); message = getResources().getString(R.string.error_unknown_host);
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
message = getResources().getString(R.string.error_404); message = getResources().getString(R.string.error_404);
} catch (Exception e) { } catch (XmlPullParserException | IOException e) {
message = e.getMessage(); message = e.getMessage();
e.printStackTrace();
} }
final String toastMessage = message; final String toastMessage = message;

View File

@ -154,7 +154,7 @@ public class AndroidCryptoProvider implements LimelightCryptoProvider {
} catch (Exception e) { } catch (Exception e) {
// Nothing should go wrong here // Nothing should go wrong here
e.printStackTrace(); e.printStackTrace();
return false; throw new RuntimeException(e);
} }
LimeLog.info("Generated a new key pair"); LimeLog.info("Generated a new key pair");

View File

@ -167,26 +167,22 @@ public class VirtualController {
} }
void sendControllerInputContext() { void sendControllerInputContext() {
try { _DBG("INPUT_MAP + " + inputContext.inputMap);
_DBG("INPUT_MAP + " + inputContext.inputMap); _DBG("LEFT_TRIGGER " + inputContext.leftTrigger);
_DBG("LEFT_TRIGGER " + inputContext.leftTrigger); _DBG("RIGHT_TRIGGER " + inputContext.rightTrigger);
_DBG("RIGHT_TRIGGER " + inputContext.rightTrigger); _DBG("LEFT STICK X: " + inputContext.leftStickX + " Y: " + inputContext.leftStickY);
_DBG("LEFT STICK X: " + inputContext.leftStickX + " Y: " + inputContext.leftStickY); _DBG("RIGHT STICK X: " + inputContext.rightStickX + " Y: " + inputContext.rightStickY);
_DBG("RIGHT STICK X: " + inputContext.rightStickX + " Y: " + inputContext.rightStickY);
if (connection != null) { if (connection != null) {
connection.sendControllerInput( connection.sendControllerInput(
inputContext.inputMap, inputContext.inputMap,
inputContext.leftTrigger, inputContext.leftTrigger,
inputContext.rightTrigger, inputContext.rightTrigger,
inputContext.leftStickX, inputContext.leftStickX,
inputContext.leftStickY, inputContext.leftStickY,
inputContext.rightStickX, inputContext.rightStickX,
inputContext.rightStickY inputContext.rightStickY
); );
}
} catch (Exception e) {
e.printStackTrace();
} }
} }
} }

View File

@ -166,58 +166,54 @@ public abstract class VirtualControllerElement extends View {
} }
protected void showConfigurationDialog() { protected void showConfigurationDialog() {
try { AlertDialog.Builder alertBuilder = new AlertDialog.Builder(getContext());
AlertDialog.Builder alertBuilder = new AlertDialog.Builder(getContext());
alertBuilder.setTitle("Configuration"); alertBuilder.setTitle("Configuration");
CharSequence functions[] = new CharSequence[]{ CharSequence functions[] = new CharSequence[]{
"Move", "Move",
"Resize", "Resize",
/*election /*election
"Set n "Set n
Disable color sormal color", Disable color sormal color",
"Set pressed color", "Set pressed color",
*/
"Cancel"
};
alertBuilder.setItems(functions, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
switch (which) {
case 0: { // move
actionEnableMove();
break;
}
case 1: { // resize
actionEnableResize();
break;
}
/*
case 2: { // set default color
actionShowNormalColorChooser();
break;
}
case 3: { // set pressed color
actionShowPressedColorChooser();
break;
}
*/ */
"Cancel" default: { // cancel
}; actionCancel();
alertBuilder.setItems(functions, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
switch (which) {
case 0: { // move
actionEnableMove();
break;
}
case 1: { // resize
actionEnableResize();
break;
}
/*
case 2: { // set default color
actionShowNormalColorChooser();
break; break;
} }
case 3: { // set pressed color
actionShowPressedColorChooser();
break;
}
*/
default: { // cancel
actionCancel();
break;
}
}
} }
}); }
AlertDialog alert = alertBuilder.create(); });
// show menu AlertDialog alert = alertBuilder.create();
alert.show(); // show menu
} catch (Exception e) { alert.show();
e.printStackTrace();
}
} }
@Override @Override

View File

@ -471,7 +471,7 @@ public class ComputerManagerService extends Service {
newDetails.activeAddress = address; newDetails.activeAddress = address;
return newDetails; return newDetails;
} catch (Exception e) { } catch (XmlPullParserException | IOException e) {
e.printStackTrace(); e.printStackTrace();
return null; return null;
} }

View File

@ -13,7 +13,10 @@ import com.limelight.nvstream.http.GfeHttpResponseException;
import com.limelight.nvstream.http.NvApp; import com.limelight.nvstream.http.NvApp;
import com.limelight.nvstream.http.NvHTTP; import com.limelight.nvstream.http.NvHTTP;
import org.xmlpull.v1.XmlPullParserException;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.UnknownHostException; import java.net.UnknownHostException;
import java.security.cert.CertificateEncodingException; import java.security.cert.CertificateEncodingException;
@ -84,8 +87,9 @@ public class ServerHelper {
message = parent.getResources().getString(R.string.error_unknown_host); message = parent.getResources().getString(R.string.error_unknown_host);
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
message = parent.getResources().getString(R.string.error_404); message = parent.getResources().getString(R.string.error_404);
} catch (Exception e) { } catch (IOException | XmlPullParserException e) {
message = e.getMessage(); message = e.getMessage();
e.printStackTrace();
} finally { } finally {
if (onComplete != null) { if (onComplete != null) {
onComplete.run(); onComplete.run();

@ -1 +1 @@
Subproject commit f42261cc925c32200da132c168a9f72b34fa367a Subproject commit 6bed1cd22e63e44c63fc37a55b10e33aeabb7892