Clean up error messages

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Samuel Holland
2018-12-15 14:46:23 -06:00
parent dcb0e9b3e8
commit 2e8d566bd4
15 changed files with 217 additions and 113 deletions
@@ -17,7 +17,7 @@ import android.util.Log;
import com.wireguard.android.Application;
import com.wireguard.android.R;
import com.wireguard.android.util.ExceptionLoggers;
import com.wireguard.android.util.ErrorMessages;
import com.wireguard.android.util.FragmentUtils;
import java.io.BufferedReader;
@@ -76,7 +76,7 @@ public class LogExporterPreference extends Preference {
private void exportLogComplete(final String filePath, @Nullable final Throwable throwable) {
if (throwable != null) {
final String error = ExceptionLoggers.unwrapMessage(throwable);
final String error = ErrorMessages.get(throwable);
final String message = getContext().getString(R.string.log_export_error, error);
Log.e(TAG, message, throwable);
Snackbar.make(
@@ -98,7 +98,7 @@ public class LogExporterPreference extends Preference {
@Override
public CharSequence getTitle() {
return getContext().getString(R.string.log_exporter_title);
return getContext().getString(R.string.log_export_title);
}
@Override
@@ -18,7 +18,7 @@ import android.util.Log;
import com.wireguard.android.Application;
import com.wireguard.android.R;
import com.wireguard.android.model.Tunnel;
import com.wireguard.android.util.ExceptionLoggers;
import com.wireguard.android.util.ErrorMessages;
import com.wireguard.android.util.FragmentUtils;
import com.wireguard.config.Config;
@@ -86,7 +86,7 @@ public class ZipExporterPreference extends Preference {
private void exportZipComplete(@Nullable final String filePath, @Nullable final Throwable throwable) {
if (throwable != null) {
final String error = ExceptionLoggers.unwrapMessage(throwable);
final String error = ErrorMessages.get(throwable);
final String message = getContext().getString(R.string.zip_export_error, error);
Log.e(TAG, message, throwable);
Snackbar.make(
@@ -108,7 +108,7 @@ public class ZipExporterPreference extends Preference {
@Override
public CharSequence getTitle() {
return getContext().getString(R.string.zip_exporter_title);
return getContext().getString(R.string.zip_export_title);
}
@Override