Skip to content

Error tracing, No way to identify JSON errors #117

@bretoreta

Description

@bretoreta

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);
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions