Spaces:
Paused
Paused
dr-data
commited on
Commit
·
0fc69ba
1
Parent(s):
c127855
Fix TypeScript error with unknown error type in test-scenarios route
Browse files
app/api/test-scenarios/route.ts
CHANGED
|
@@ -54,10 +54,11 @@ export async function POST() {
|
|
| 54 |
result: result.detection
|
| 55 |
});
|
| 56 |
} catch (error) {
|
|
|
|
| 57 |
results.push({
|
| 58 |
scenario: scenario.name,
|
| 59 |
input: scenario.data,
|
| 60 |
-
error:
|
| 61 |
});
|
| 62 |
}
|
| 63 |
}
|
|
|
|
| 54 |
result: result.detection
|
| 55 |
});
|
| 56 |
} catch (error) {
|
| 57 |
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
| 58 |
results.push({
|
| 59 |
scenario: scenario.name,
|
| 60 |
input: scenario.data,
|
| 61 |
+
error: errorMessage
|
| 62 |
});
|
| 63 |
}
|
| 64 |
}
|