midjourney-api icon indicating copy to clipboard operation
midjourney-api copied to clipboard

MidJourney error "Sorry! Could not complete the job!" not handled. Imagine stuck indefinitely

Open BastienPenalba opened this issue 2 years ago • 1 comments

the code that reproduces this issue or a replay of the bug

Hello,

I use this package only for Image and Upscale. Most of the time, things a running smoothly, but I sometimes get a MidJourney error like the following: Capture d’écran 2023-10-30 à 14 43 38

The thing is that in this case the await Imagine(...) never returns anything and seems to stay stuck, not throwing any error:

async function imagineTask(prompt) {
    return await client.Imagine(
        prompt,
        (uri, progress) => {
            console.log("Imagine", uri, "progress", progress);
        }
    );
}

I have the MaxWait setting set at 150, but from what I saw in the code is that it's only used to wait for the message. In my case the message seems to appear so I don't have any timeout error either. I though of handling the timeout myself but I'm affraid the Imagine process will keep running in the background and pile up some errors in the longterm since I don't have any way to cancel the Imagine promise.

Describe the bug

Describe the bug Imagine doesn't throw an error in case of MidJourney failure, neither a timeout

Expected behavior I'd expect client.Imagine(...) to throw an error if MidJourney failed on discord, or at least have some sort of timeout that would cancel the Imagine promise so I can't get a feedback on this error from Discord and handle it properly.

Screenshots

error log

No log since I don't get any error thrown

BastienPenalba avatar Nov 02 '23 09:11 BastienPenalba

same issue encountered, this libarary not handle well at error happed.

ManInTheWind avatar Dec 20 '23 05:12 ManInTheWind