update login error message

This commit is contained in:
Fran Jurmanović
2025-08-27 21:33:28 +02:00
parent 9ce5802dc6
commit 55e0370004
5 changed files with 51 additions and 10 deletions

View File

@@ -11,7 +11,10 @@ export async function startServerAction(serverId: string) {
revalidatePath('/dashboard');
revalidatePath(`/dashboard/server/${serverId}`);
} catch (error) {
throw new Error(error instanceof Error ? error.message : 'Failed to start server');
return {
success: false,
message: error instanceof Error ? error.message : 'Failed to start server'
};
}
}
@@ -22,7 +25,10 @@ export async function stopServerAction(serverId: string) {
revalidatePath('/dashboard');
revalidatePath(`/dashboard/server/${serverId}`);
} catch (error) {
throw new Error(error instanceof Error ? error.message : 'Failed to stop server');
return {
success: false,
message: error instanceof Error ? error.message : 'Failed to stop server'
};
}
}
@@ -33,6 +39,9 @@ export async function restartServerAction(serverId: string) {
revalidatePath('/dashboard');
revalidatePath(`/dashboard/server/${serverId}`);
} catch (error) {
throw new Error(error instanceof Error ? error.message : 'Failed to restart server');
return {
success: false,
message: error instanceof Error ? error.message : 'Failed to restart server'
};
}
}