diff --git a/chrome/content/zotero/preferences/preferences_sync.js b/chrome/content/zotero/preferences/preferences_sync.js
index 6c94482bf..2773784f9 100644
--- a/chrome/content/zotero/preferences/preferences_sync.js
+++ b/chrome/content/zotero/preferences/preferences_sync.js
@@ -51,9 +51,7 @@ Zotero_Preferences.Sync = {
 			}
 			catch (e) {
 				// API key wrong/invalid
-				if (!(e instanceof Zotero.HTTP.UnexpectedStatusException)
-						&& !(e instanceof Zotero.HTTP.TimeoutException)
-						&& !(e instanceof Zotero.HTTP.BrowserOfflineException)) {
+				if (e instanceof Zotero.Error && e.error == Zotero.Error.ERROR_API_KEY_INVALID) {
 					Zotero.alert(
 						window,
 						Zotero.getString('general.error'),
diff --git a/chrome/content/zotero/xpcom/sync/syncAPIClient.js b/chrome/content/zotero/xpcom/sync/syncAPIClient.js
index 4e302dcbf..802f085ea 100644
--- a/chrome/content/zotero/xpcom/sync/syncAPIClient.js
+++ b/chrome/content/zotero/xpcom/sync/syncAPIClient.js
@@ -55,7 +55,7 @@ Zotero.Sync.APIClient.prototype = {
 		Object.assign(opts, options);
 		opts.successCodes = [200, 403, 404];
 		var xmlhttp = yield this.makeRequest("GET", uri, opts);
-		if (xmlhttp.status == 403 || xmlhttp.status == 404) {
+		if (xmlhttp.status == 403) {
 			return false;
 		}
 		var json = this._parseJSON(xmlhttp.responseText);
diff --git a/chrome/content/zotero/xpcom/sync/syncRunner.js b/chrome/content/zotero/xpcom/sync/syncRunner.js
index 5cab5de5e..f1f6184d9 100644
--- a/chrome/content/zotero/xpcom/sync/syncRunner.js
+++ b/chrome/content/zotero/xpcom/sync/syncRunner.js
@@ -269,7 +269,7 @@ Zotero.Sync.Runner_Module = function (options = {}) {
 		var json = yield client.getKeyInfo(options);
 		Zotero.debug(json);
 		if (!json) {
-			throw new Zotero.Error("API key not set", Zotero.Error.ERROR_API_KEY_NOT_SET);
+			throw new Zotero.Error("API key not set", Zotero.Error.ERROR_API_KEY_INVALID);
 		}
 		
 		// Sanity check