deepgram-js-sdk icon indicating copy to clipboard operation
deepgram-js-sdk copied to clipboard

More Verbose Websocket Errors

Open joshraymo opened this issue 1 year ago • 1 comments

Proposed changes

Hello! I made a post on the discord but was prompted to open an issue so here I am! I am currently attempting to implement a live transcription with Deepgram and Ably but am unable to make a connection to the Deepgram api.

However, I have had an incredibly hard time debugging the issue because the error that is returned from the api is not verbose, and as such, makes it very hard to tell what the issue actually is. I've been stuck on this for a few days now and unfortunately am having a hard time seeing a path forward

If you could make the errors more descriptive, including an error code and message that would be amazing, because as it stands it's very hard to figure out what is wrong. I've included a screenshot of the error and relevant code, as well as a link to the original post on discord Screenshot 2024-04-21 134815 Screenshot 2024-04-21 140616

https://discord.com/channels/1108042150941294664/1231667143393673246

joshraymo avatar Apr 21 '24 19:04 joshraymo

There is an issue with the websocket package we're using, whereby it suppresses the connection errors and just emits an error. Very frustrating! I'm looking to replace it entirely with our own isomorphic code for browser/server websockets, which should give us a lot of improvements across the board

Might take me a couple of weeks to get to this

lukeocodes avatar Apr 27 '24 10:04 lukeocodes

Any progress on this one? I have the same issue - I need help figuring out why the error occurs.

import {createClient, LiveTranscriptionEvents} from '@deepgram/sdk';

const deepgramClient = createClient(process.env.DEEPGRAM_API_KEY ?? '');

const deepgram = deepgramClient.listen.live({
        smart_format: true,
        model: 'nova-2'
    });

deepgram.on(LiveTranscriptionEvents.Error, error =>
    {
       console.error('Unknown error:', error);
    });

...

It just fires an error directly.

skitsanos avatar Jun 10 '24 05:06 skitsanos