From b2b983b05a653ed67a3006e5dfb9cbce2f0309c8 Mon Sep 17 00:00:00 2001 From: Risto Lahtela <24460436+Rsl1122@users.noreply.github.com> Date: Sat, 8 Aug 2020 17:20:17 +0300 Subject: [PATCH] Tell what to do when missing MySQL privilege Affects issues: - Close #1510 --- .../djrapitops/plan/exceptions/database/DBOpException.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Plan/common/src/main/java/com/djrapitops/plan/exceptions/database/DBOpException.java b/Plan/common/src/main/java/com/djrapitops/plan/exceptions/database/DBOpException.java index 4f3149d97..b8a004b64 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/exceptions/database/DBOpException.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/exceptions/database/DBOpException.java @@ -123,6 +123,11 @@ public class DBOpException extends IllegalStateException implements ExceptionWit context.related("Constraint Violation") .whatToDo("Report this, there is an SQL Constraint Violation."); break; + // Custom rules based on reported errors + case 1142: + context.related("Missing privilege") + .whatToDo("Grant the required privileges to your MySQL user (often 'REFERENCES' privilege is missing)."); + break; default: context.related("Unknown SQL Error code"); }