ai icon indicating copy to clipboard operation
ai copied to clipboard

"Unhandled runtime error"—best practices for error handling in API routes?

Open GLips opened this issue 2 years ago • 0 comments

If your backend throws an error before sending the initial response, it looks like the generator function responsible for grabbing the response inside the useCompletion hook just keeps chugging along, even though the response isn't streamable. This throws an error I seem to be unable to try/catch by e.g. wrapping my complete call.

CleanShot 2023-06-20 at 15 52 19@2x

Is there another way to do this?

GLips avatar Jun 20 '23 22:06 GLips