mirror of
https://github.com/xtr-dev/rondevu-server.git
synced 2025-12-10 10:53:24 +00:00
Add proper error handling for session ID clashes
Return 409 Conflict status when user-provided connection ID already exists, instead of generic 500 error. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -152,6 +152,12 @@ export function createApp(storage: Storage, config: AppConfig) {
|
||||
return c.json({ code }, 200);
|
||||
} catch (err) {
|
||||
console.error('Error creating offer:', err);
|
||||
|
||||
// Check if it's a session code clash error
|
||||
if (err instanceof Error && err.message.includes('already exists')) {
|
||||
return c.json({ error: err.message }, 409);
|
||||
}
|
||||
|
||||
return c.json({ error: 'Internal server error' }, 500);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user