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);
}
} catch (IOException e) {
e.printStackTrace();
Log.e(Constants.TAG, "IOException at HkpKeyserver", e);
throw new QueryFailedException("Keyserver '" + mHost + "' is unavailable. Check your Internet connection!" +
proxy == null?"":" Using proxy " + proxy);
}
@ -351,12 +351,12 @@ public class HkpKeyserver extends Keyserver {
@Override
public String get(String keyIdHex, Proxy proxy) throws QueryFailedException {
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;
try {
data = query(request, proxy);
} catch (HttpError httpError) {
httpError.printStackTrace();
Log.e(Constants.TAG, "Failed to get key at HkpKeyserver", httpError);
throw new QueryFailedException("not found");
}
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.util.FileHelper;
import org.sufficientlysecure.keychain.util.InputData;
import org.sufficientlysecure.keychain.util.Log;
import org.sufficientlysecure.keychain.util.ProgressScaler;
import java.io.ByteArrayInputStream;
@ -85,7 +86,7 @@ public class SignEncryptOperation extends BaseOperation<SignEncryptParcel> {
input.getSignatureMasterKeyId()).getSecretSignId();
input.setSignatureSubKeyId(signKeyId);
} catch (PgpKeyNotFoundException e) {
e.printStackTrace();
Log.e(Constants.TAG, "Key not found", e);
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);
inputData = new InputData(inputStream, inputSize);
} catch (FileNotFoundException e) {
e.printStackTrace();
Log.e(Constants.TAG, "File not found at " + input.getInputUri(), e);
return null;
}
}

View File

@ -43,7 +43,9 @@ import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.util.Log;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
@ -207,7 +209,7 @@ public class PassphraseWizardActivity extends FragmentActivity {
// transaction.replace(R.id.fragmentContainer, lpf).addToBackStack(null).commit();
}
} catch (IOException | FormatException e) {
e.printStackTrace();
Log.e(Constants.TAG, "Failed to write on NFC tag", e);
}
} else if (readNFC && AUTHENTICATION.equals(selectedAction)) {
@ -232,7 +234,7 @@ public class PassphraseWizardActivity extends FragmentActivity {
}
}
} 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 {
password = readText(ndefRecord);
} 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.view.View;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.util.Log;
/**
* Created by Matt Allen
@ -115,7 +117,7 @@ public class PasswordStrengthView extends View {
mColorStrong = style.getColor(R.styleable.PasswordStrengthView_color_strong,
COLOR_STRONG);
} 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
mGuidePaint = new Paint(Paint.ANTI_ALIAS_FLAG);