removed e.printStackTrace from several places

This commit is contained in:
Adithya Abraham Philip 2015-06-18 16:12:11 +05:30
parent 7b190f61e2
commit b56b67d87a
5 changed files with 14 additions and 9 deletions

View File

@ -232,7 +232,7 @@ public class HkpKeyserver extends Keyserver {
throw new HttpError(response.code(), responseBody); throw new HttpError(response.code(), responseBody);
} }
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); Log.e(Constants.TAG, "IOException at HkpKeyserver", e);
throw new QueryFailedException("Keyserver '" + mHost + "' is unavailable. Check your Internet connection!" + throw new QueryFailedException("Keyserver '" + mHost + "' is unavailable. Check your Internet connection!" +
proxy == null?"":" Using proxy " + proxy); proxy == null?"":" Using proxy " + proxy);
} }
@ -351,12 +351,12 @@ public class HkpKeyserver extends Keyserver {
@Override @Override
public String get(String keyIdHex, Proxy proxy) throws QueryFailedException { public String get(String keyIdHex, Proxy proxy) throws QueryFailedException {
String request = "/pks/lookup?op=get&options=mr&search=" + keyIdHex; String request = "/pks/lookup?op=get&options=mr&search=" + keyIdHex;
Log.d(Constants.TAG, "hkp keyserver get: " + request); Log.d(Constants.TAG, "hkp keyserver get: " + request + " using Proxy: " + proxy);
String data; String data;
try { try {
data = query(request, proxy); data = query(request, proxy);
} catch (HttpError httpError) { } catch (HttpError httpError) {
httpError.printStackTrace(); Log.e(Constants.TAG, "Failed to get key at HkpKeyserver", httpError);
throw new QueryFailedException("not found"); throw new QueryFailedException("not found");
} }
Matcher matcher = PgpHelper.PGP_PUBLIC_KEY.matcher(data); Matcher matcher = PgpHelper.PGP_PUBLIC_KEY.matcher(data);

View File

@ -37,6 +37,7 @@ import org.sufficientlysecure.keychain.service.input.RequiredInputParcel.NfcSign
import org.sufficientlysecure.keychain.service.input.RequiredInputParcel.RequiredInputType; import org.sufficientlysecure.keychain.service.input.RequiredInputParcel.RequiredInputType;
import org.sufficientlysecure.keychain.util.FileHelper; import org.sufficientlysecure.keychain.util.FileHelper;
import org.sufficientlysecure.keychain.util.InputData; import org.sufficientlysecure.keychain.util.InputData;
import org.sufficientlysecure.keychain.util.Log;
import org.sufficientlysecure.keychain.util.ProgressScaler; import org.sufficientlysecure.keychain.util.ProgressScaler;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
@ -85,7 +86,7 @@ public class SignEncryptOperation extends BaseOperation<SignEncryptParcel> {
input.getSignatureMasterKeyId()).getSecretSignId(); input.getSignatureMasterKeyId()).getSecretSignId();
input.setSignatureSubKeyId(signKeyId); input.setSignatureSubKeyId(signKeyId);
} catch (PgpKeyNotFoundException e) { } catch (PgpKeyNotFoundException e) {
e.printStackTrace(); Log.e(Constants.TAG, "Key not found", e);
return new SignEncryptResult(SignEncryptResult.RESULT_ERROR, log, results); return new SignEncryptResult(SignEncryptResult.RESULT_ERROR, log, results);
} }
} }

View File

@ -98,7 +98,7 @@ public class PgpDecryptVerify extends BaseOperation<PgpDecryptVerifyInputParcel>
long inputSize = FileHelper.getFileSize(mContext, input.getInputUri(), 0); long inputSize = FileHelper.getFileSize(mContext, input.getInputUri(), 0);
inputData = new InputData(inputStream, inputSize); inputData = new InputData(inputStream, inputSize);
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
e.printStackTrace(); Log.e(Constants.TAG, "File not found at " + input.getInputUri(), e);
return null; return null;
} }
} }

View File

@ -43,7 +43,9 @@ import android.widget.EditText;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.util.Log;
import java.io.IOException; import java.io.IOException;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
@ -207,7 +209,7 @@ public class PassphraseWizardActivity extends FragmentActivity {
// transaction.replace(R.id.fragmentContainer, lpf).addToBackStack(null).commit(); // transaction.replace(R.id.fragmentContainer, lpf).addToBackStack(null).commit();
} }
} catch (IOException | FormatException e) { } catch (IOException | FormatException e) {
e.printStackTrace(); Log.e(Constants.TAG, "Failed to write on NFC tag", e);
} }
} else if (readNFC && AUTHENTICATION.equals(selectedAction)) { } else if (readNFC && AUTHENTICATION.equals(selectedAction)) {
@ -232,7 +234,7 @@ public class PassphraseWizardActivity extends FragmentActivity {
} }
} }
} catch (IOException | FormatException e) { } catch (IOException | FormatException e) {
e.printStackTrace(); Log.e(Constants.TAG, "Failed to read NFC tag", e);
} }
} }
} }
@ -263,7 +265,7 @@ public class PassphraseWizardActivity extends FragmentActivity {
try { try {
password = readText(ndefRecord); password = readText(ndefRecord);
} catch (UnsupportedEncodingException e) { } catch (UnsupportedEncodingException e) {
e.printStackTrace(); Log.e(Constants.TAG, "Failed to read password from tag", e);
} }
} }
} }

View File

@ -31,7 +31,9 @@ import android.graphics.Paint;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.view.View; import android.view.View;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.util.Log;
/** /**
* Created by Matt Allen * Created by Matt Allen
@ -115,7 +117,7 @@ public class PasswordStrengthView extends View {
mColorStrong = style.getColor(R.styleable.PasswordStrengthView_color_strong, mColorStrong = style.getColor(R.styleable.PasswordStrengthView_color_strong,
COLOR_STRONG); COLOR_STRONG);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); Log.e(Constants.TAG, "Failed to retrieve attribute values for PasswordStrengthView", e);
} }
// Create and style the paint used for drawing the guide on the indicator // Create and style the paint used for drawing the guide on the indicator
mGuidePaint = new Paint(Paint.ANTI_ALIAS_FLAG); mGuidePaint = new Paint(Paint.ANTI_ALIAS_FLAG);