fix: error message from backend

This commit is contained in:
Nicolas Meienberger
2025-09-27 12:00:32 +02:00
parent ca7c6c7ecf
commit 9f3fb8a302
4 changed files with 13 additions and 7 deletions

View File

@@ -26,6 +26,9 @@ export const HealthchecksCard = ({ volume }: Props) => {
}
toast.success("Health check completed", { description: "The volume is healthy." });
},
onError: (error) => {
toast.error("Health check failed", { description: error.message });
},
});
const toggleAutoRemount = useMutation({
@@ -35,6 +38,9 @@ export const HealthchecksCard = ({ volume }: Props) => {
description: `Auto remount is now ${d.volume.autoRemount ? "enabled" : "paused"}.`,
});
},
onError: (error) => {
toast.error("Update failed", { description: error.message });
},
});
return (

View File

@@ -1,11 +1,11 @@
import { useQuery } from "@tanstack/react-query";
import { Unplug } from "lucide-react";
import * as YML from "yaml";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "~/components/ui/card";
import { CodeBlock } from "~/components/ui/code-block";
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "~/components/ui/table";
import type { Volume } from "~/lib/types";
import { getContainersUsingVolumeOptions } from "../../../api-client/@tanstack/react-query.gen";
import { Unplug } from "lucide-react";
type Props = {
volume: Volume;
@@ -49,7 +49,7 @@ export const DockerTabContent = ({ volume }: Props) => {
<Card>
<CardHeader>
<CardTitle>Plug-and-play Docker integration</CardTitle>
<CardDescription className="mt-2">
<CardDescription>
This volume can be used in your Docker Compose files by referencing it as an external volume. The example
demonstrates how to mount the volume to a service (nginx in this case). Make sure to adjust the path inside
the container to fit your application's needs

View File

@@ -5,10 +5,10 @@ import { logger as honoLogger } from "hono/logger";
import { openAPISpecs } from "hono-openapi";
import { runDbMigrations } from "./db/db";
import { driverController } from "./modules/driver/driver.controller";
import { volumeController } from "./modules/volumes/volume.controller";
import { logger } from "./utils/logger";
import { startup } from "./modules/lifecycle/startup";
import { volumeController } from "./modules/volumes/volume.controller";
import { handleServiceError } from "./utils/errors";
import { logger } from "./utils/logger";
export const generalDescriptor = (app: Hono) =>
openAPISpecs(app, {
@@ -51,7 +51,7 @@ app.onError((err, c) => {
const { status, message } = handleServiceError(err);
return c.json({ error: message }, status);
return c.json({ message }, status);
});
const socketPath = "/run/docker/plugins/ironmount.sock";

View File

@@ -7,17 +7,17 @@ import {
type GetVolumeResponseDto,
getContainersDto,
getVolumeDto,
healthCheckDto,
type ListContainersResponseDto,
type ListVolumesResponseDto,
listVolumesDto,
mountVolumeDto,
testConnectionBody,
testConnectionDto,
type UpdateVolumeResponseDto,
unmountVolumeDto,
updateVolumeBody,
updateVolumeDto,
healthCheckDto,
type UpdateVolumeResponseDto,
} from "./volume.dto";
import { volumeService } from "./volume.service";