diff --git a/apps/web/app/api/submission/route.ts b/apps/web/app/api/submission/route.ts index c49e915..a127ae9 100644 --- a/apps/web/app/api/submission/route.ts +++ b/apps/web/app/api/submission/route.ts @@ -218,7 +218,7 @@ export async function POST(req: NextRequest) { console.log(error.message) return NextResponse.json( { - message: "something went wrong", + message: error.message, status: 500 } ); diff --git a/apps/web/components/problem-page/SubmitProblem.tsx b/apps/web/components/problem-page/SubmitProblem.tsx index b097136..c6f8874 100644 --- a/apps/web/components/problem-page/SubmitProblem.tsx +++ b/apps/web/components/problem-page/SubmitProblem.tsx @@ -126,7 +126,7 @@ export function SubmitProblem({ if (response.data.status != 200) { setStatus(SubmitStatus.FAILED); - toast.error("Something went wrong"); + toast.error(response.data.message); return; };