diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/misc/ApplyEditsCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/misc/ApplyEditsCommand.java index 482e69f89..2a6e11980 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/misc/ApplyEditsCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/misc/ApplyEditsCommand.java @@ -85,11 +85,7 @@ public class ApplyEditsCommand extends SingleCommand { try { data = WebEditor.readDataFromBytebin(plugin.getBytebin(), code); } catch (UnsuccessfulRequestException e) { - if (e.getResponse().code() == 403) { - Message.EDITOR_HTTP_FORBIDDEN_FAILURE.send(sender); - } else { - Message.EDITOR_HTTP_REQUEST_FAILURE.send(sender, e.getResponse().code(), e.getResponse().message()); - } + Message.EDITOR_HTTP_REQUEST_FAILURE.send(sender, e.getResponse().code(), e.getResponse().message()); return CommandResult.STATE_ERROR; } catch (IOException e) { new RuntimeException("Error uploading data to bytebin", e).printStackTrace(); diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/misc/TreeCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/misc/TreeCommand.java index 178ab5df1..43b1b8207 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/misc/TreeCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/misc/TreeCommand.java @@ -98,11 +98,7 @@ public class TreeCommand extends SingleCommand { try { id = view.uploadPasteData(plugin.getBytebin(), sender, user, permissionData); } catch (UnsuccessfulRequestException e) { - if (e.getResponse().code() == 403) { - Message.GENERIC_HTTP_FORBIDDEN_FAILURE.send(sender); - } else { - Message.GENERIC_HTTP_REQUEST_FAILURE.send(sender, e.getResponse().code(), e.getResponse().message()); - } + Message.GENERIC_HTTP_REQUEST_FAILURE.send(sender, e.getResponse().code(), e.getResponse().message()); return CommandResult.STATE_ERROR; } catch (IOException e) { new RuntimeException("Error uploading data to bytebin", e).printStackTrace(); diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/misc/VerboseCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/misc/VerboseCommand.java index 115dd84da..4024d819a 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/misc/VerboseCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/misc/VerboseCommand.java @@ -119,11 +119,7 @@ public class VerboseCommand extends SingleCommand { try { id = listener.uploadPasteData(plugin.getBytebin()); } catch (UnsuccessfulRequestException e) { - if (e.getResponse().code() == 403) { - Message.GENERIC_HTTP_FORBIDDEN_FAILURE.send(sender); - } else { - Message.GENERIC_HTTP_REQUEST_FAILURE.send(sender, e.getResponse().code(), e.getResponse().message()); - } + Message.GENERIC_HTTP_REQUEST_FAILURE.send(sender, e.getResponse().code(), e.getResponse().message()); return CommandResult.STATE_ERROR; } catch (IOException e) { new RuntimeException("Error uploading data to bytebin", e).printStackTrace(); diff --git a/common/src/main/java/me/lucko/luckperms/common/locale/message/Message.java b/common/src/main/java/me/lucko/luckperms/common/locale/message/Message.java index 1f7b3f0f5..3abd69234 100644 --- a/common/src/main/java/me/lucko/luckperms/common/locale/message/Message.java +++ b/common/src/main/java/me/lucko/luckperms/common/locale/message/Message.java @@ -143,7 +143,6 @@ public enum Message { TREE_URL("&aPermission tree URL:", true), GENERIC_HTTP_REQUEST_FAILURE("&cUnable to communicate with the web app. (response code &4{}&c, message='{}')", true), - GENERIC_HTTP_FORBIDDEN_FAILURE("&cUnable to communicate with the web app - '&4forbidden access&c' error &4403&3. You network provider or firewall (antivirus / content filter?) may have blocked access to the resource.", true), GENERIC_HTTP_UNKNOWN_FAILURE("&cUnable to communicate with the web app. Check the console for errors.", true), SEARCH_SEARCHING("&aSearching for users and groups with &bpermissions {}&a...", true), @@ -170,7 +169,6 @@ public enum Message { EDITOR_URL("&aClick the link below to open the editor:", true), EDITOR_HTTP_REQUEST_FAILURE("&cUnable to communicate with the editor. (response code &4{}&c, message='{}')", true), - EDITOR_HTTP_FORBIDDEN_FAILURE("&cUnable to communicate with the editor - '&4forbidden access&c' error &4403&3. You network provider or firewall (antivirus / content filter?) may have blocked access to the resource.", true), EDITOR_HTTP_UNKNOWN_FAILURE("&cUnable to communicate with the editor. Check the console for errors.", true), CHECK_RESULT("&aPermission check result on user &b{}&a for permission &b{}&a: &f{}", true), diff --git a/common/src/main/java/me/lucko/luckperms/common/web/WebEditor.java b/common/src/main/java/me/lucko/luckperms/common/web/WebEditor.java index c235263c3..3010e64c7 100644 --- a/common/src/main/java/me/lucko/luckperms/common/web/WebEditor.java +++ b/common/src/main/java/me/lucko/luckperms/common/web/WebEditor.java @@ -137,11 +137,7 @@ public final class WebEditor { try { pasteId = plugin.getBytebin().postContent(bytesOut.toByteArray(), AbstractHttpClient.JSON_TYPE, false).key(); } catch (UnsuccessfulRequestException e) { - if (e.getResponse().code() == 403) { - Message.EDITOR_HTTP_FORBIDDEN_FAILURE.send(sender); - } else { - Message.EDITOR_HTTP_REQUEST_FAILURE.send(sender, e.getResponse().code(), e.getResponse().message()); - } + Message.EDITOR_HTTP_REQUEST_FAILURE.send(sender, e.getResponse().code(), e.getResponse().message()); return CommandResult.STATE_ERROR; } catch (IOException e) { new RuntimeException("Error uploading data to bytebin", e).printStackTrace();