laravel-woocommerce
laravel-woocommerce copied to clipboard
Error tracing, No way to identify JSON errors
As is, whenever an error happens with Woocommerce api request the package just returns a plain JSON error message, no context for the error and no way to even identify what went wrong. Please implement the methods to return the whole context of the error not just the message
public function getRequest()
{
try {
return $this->client->http->getRequest();
} catch (\Exception $e) {
throw new \Exception($e->getMessage(), 1);
}
}
Refractor to
public function getRequest()
{
try {
return $this->client->http->getRequest();
} catch (\Exception $e) {
throw new \Exception($e, 1);
}
}