Skip to content

Commit 868d1e5

Browse files
committed
fix: suppress 4xx error logging from Pterodactyl API (callers handle gracefully), fix rename endpoint path
1 parent 4822f5a commit 868d1e5

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

services/pyrodactyl.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ async function pteroFetch(path, options = {}) {
7676
continue;
7777
}
7878
if (!res.ok) {
79-
recordPteroError(`${res.status} ${res.statusText}`);
79+
if (res.status >= 500) {
80+
recordPteroError(`${res.status} ${res.statusText}`);
81+
}
8082
const text = await res.text();
8183
throw new Error(`Pterodactyl API error ${res.status}: ${text.slice(0, 200)}`);
8284
}
@@ -335,7 +337,7 @@ export async function getPergoServerIdsByEgg(nestId, eggId) {
335337

336338
export async function renamePteroServer(serverId, name) {
337339
const server = await getServerById(serverId);
338-
await pteroFetch(`/servers/${serverId}/details`, {
340+
await pteroFetch(`/servers/${serverId}`, {
339341
method: 'PATCH',
340342
body: JSON.stringify({
341343
name,

0 commit comments

Comments
 (0)