remove-bg icon indicating copy to clipboard operation
remove-bg copied to clipboard

Sending the fatal errors when credits ends in the account

Open MuhammadWaseem0006 opened this issue 3 years ago • 1 comments

Hello, Hope you are doing great

We have an issue, when have integrated the API into our project. During development we found an issue, our credits ends and it throw the errors while it should send errors in the response.

We have use below code to remove background

$removebg = new RemoveBg($this->apiKey); $response = $removebg->file($image_url)->save($targetFile);

error

It should send back the response, so we can show specific message to our users in case of credits goes to 0

Is there any solution for that ?

Thanks

MuhammadWaseem0006 avatar Jun 04 '21 13:06 MuhammadWaseem0006

just add a try catch :S Errors are expected to be thrown, not returned :o

psociety avatar Mar 03 '22 15:03 psociety

Yes, you should wrap your code in a try/catch block to handle exceptions. It is the responsibility of the developer to handle exceptions that are thrown.

mtownsend5512 avatar Jan 09 '23 22:01 mtownsend5512