remove-bg
remove-bg copied to clipboard
Sending the fatal errors when credits ends in the account
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);
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
just add a try catch :S Errors are expected to be thrown, not returned :o
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.