helicone
helicone copied to clipboard
[Bug]: Improperly Formatted Error from API Call
What happened?
This request causes the API to return an html error response instead of the validation error. I figured out it was missing some parameters but the error message itself is a bug.
The Request
curl --request POST \
--url https://api.helicone.ai/v1/user/metrics/query \
--header 'Content-Type: application/json' \
--header 'authorization: <my-api-key>' \
--data '{
"filter": {
"request_response_rmt": {
"user_id": {
"equals": "17"
}
}
}
}'
The Error
This is returned in the "error" property of the response.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>ValidateError<br> at ExpressTemplateService.getValidatedArgs (/usr/src/app/valhalla/jawn/node_modules/@tsoa/runtime/dist/routeGeneration/templates/express/expressTemplateService.js:70:19)<br> at UserController_getUserMetrics (/usr/src/app/valhalla/jawn/dist/valhalla/jawn/src/tsoa-build/public/routes.js:3624:45)<br> at Layer.handle [as handle_request] (/usr/src/app/valhalla/jawn/node_modules/express/lib/router/layer.js:95:5)<br> at next (/usr/src/app/valhalla/jawn/node_modules/express/lib/router/route.js:149:13)<br> at runAuthenticationMiddleware (/usr/src/app/valhalla/jawn/dist/valhalla/jawn/src/tsoa-build/public/routes.js:7204:17)<br> at process.processTicksAndRejections (node:internal/process/task_queues:95:5)</pre>
</body>
</html>
Relevant log output
No response
Twitter / LinkedIn details
No response