Skip to content

Commit

Permalink
Don't throw errors on placeholder request
Browse files Browse the repository at this point in the history
Affects issues:
- Fixed #3682
  • Loading branch information
AuroraLS3 committed Jul 1, 2024
1 parent 511b41e commit 8a23b98
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.djrapitops.plan.storage.database.Database;
import com.djrapitops.plan.storage.database.queries.containers.ContainerFetchQueries;
import com.djrapitops.plan.utilities.dev.Untrusted;
import net.playeranalytics.plugin.server.PluginLogger;
import org.jetbrains.annotations.Nullable;

import javax.inject.Inject;
Expand Down Expand Up @@ -54,15 +55,18 @@ public final class PlanPlaceholders {

private final DBSystem dbSystem;
private final Identifiers identifiers;
private final PluginLogger logger;

@Inject
public PlanPlaceholders(
DBSystem dbSystem,
Set<Placeholders> placeholderRegistries,
Identifiers identifiers
Identifiers identifiers,
PluginLogger logger
) {
this.dbSystem = dbSystem;
this.identifiers = identifiers;
this.logger = logger;

this.playerPlaceholders = new HashMap<>();
this.staticPlaceholders = new HashMap<>();
Expand Down Expand Up @@ -118,7 +122,8 @@ public String onPlaceholderRequest(UUID uuid, @Untrusted String placeholder, @Un
if (dbSystem.getDatabase().getState() == Database.State.CLOSED) {
return "Plan Bug #3020, please report";
}
throw e;
logger.warn("Failed to get data for placeholder '" + placeholder + "', " + e.getMessage(), e);
return "db error";
}
}

Expand Down

0 comments on commit 8a23b98

Please sign in to comment.