Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/app/api/analyze-errors/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ interface AiriaResponse {
success: boolean;
message?: string;
error?: string;
data?: any;
data?: unknown;
}

interface ErrorAnalysis {
Expand Down Expand Up @@ -157,7 +157,7 @@ function parseErrorAnalysis(airiaResponse: string, originalError?: string): Erro
const lines = airiaResponse.split('\n').filter(line => line.trim());

// Default values
let userFriendlyMessage = airiaResponse;
const userFriendlyMessage = airiaResponse;
let severity: 'low' | 'medium' | 'high' | 'critical' = 'medium';
let suggestedActions: string[] = [];
let errorCode: string | undefined;
Expand Down
10 changes: 9 additions & 1 deletion src/app/api/submit/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
import { NextRequest, NextResponse } from "next/server";

interface UserData {
id: string;
name: string;
email: string;
message: string;
submittedAt: string;
}

export async function POST(request: NextRequest) {
try {
const body = await request.json();
Expand Down Expand Up @@ -60,7 +68,7 @@ export async function POST(request: NextRequest) {
}

// Simulate a function that could fail in a real application
async function processUserData(userData: any) {
async function processUserData(userData: UserData) {
// Simulate a realistic business logic error
// This could be a database operation, external API call, or data validation

Expand Down
2 changes: 1 addition & 1 deletion src/components/ErrorAnalyzer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { useState, useEffect } from "react";
import { useState } from "react";

interface ErrorAnalysis {
originalError: string;
Expand Down