During our tests we noticed that some errors simply do not show if we use the SDK, we only get an http response 400 with elevenLabsClient.audioIsolation.audioIsolation(), but if we call the API directly with https://api.elevenlabs.io/v1/audio-isolation, this is the kind of error object we get:
We would benefit a lot if you could make it possible to return this kind of error body in the SDK, for instance to use the status to know what happened and show a nice error message for our users.
For the sake of completeness, our code looks like this:
try {
return this.client.audioIsolation.audioIsolation({ audio });
} catch (e) {
if (e instanceof UnprocessableEntityError) {
throw new Error(`ElevenLabsError Audio cannot be cleaned ${e}`);
}
throw new Error(`ElevenLabsError Unknown error while cleaning audio ${e}`);
}
During our tests we noticed that some errors simply do not show if we use the SDK, we only get an http response 400 with
elevenLabsClient.audioIsolation.audioIsolation()
, but if we call the API directly withhttps://api.elevenlabs.io/v1/audio-isolation
, this is the kind of error object we get:We would benefit a lot if you could make it possible to return this kind of error body in the SDK, for instance to use the status to know what happened and show a nice error message for our users.
For the sake of completeness, our code looks like this: