Skip to content
This repository has been archived by the owner on Dec 22, 2019. It is now read-only.

Trying to get property of non-object #146

Open
dk-jessn opened this issue Sep 5, 2018 · 1 comment
Open

Trying to get property of non-object #146

dk-jessn opened this issue Sep 5, 2018 · 1 comment

Comments

@dk-jessn
Copy link
Contributor

dk-jessn commented Sep 5, 2018

[2018-09-05 12:57:24] local.ERROR: exception 'ErrorException' with message
'Trying to get property of non-object' in /vagrant/api/vendor/bogardo/mailgun/src/Http/Response.php:37

public function __construct(stdClass $response)
{
    $this->status = $response->http_response_code;
    $this->message = $response->http_response_body->message;  // Line 37
    $this->id = property_exists($response->http_response_body, 'id') ? $response->http_response_body->id : '';
    $this->data = null;
}

It looks like that no body is returned, and it is not handled in the ctor properly?

@martsie
Copy link

martsie commented Sep 6, 2018

I faced the same issue.

There's an error in the documentation for this module because it says to publish the config but also to edit .env file and use either. The problem is if you publish the config it'll use that instead of the .env variables you set.

Try setting the variables in your mailgun.php file and make sure the domain is correct and see if that helps.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants