Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception thrown in Sneaker when capturing an exception (ErrorException: Trying to get property of non-object) #7

Closed
trinca opened this issue Aug 30, 2017 · 4 comments

Comments

@trinca
Copy link

trinca commented Aug 30, 2017

I have just one address in config file: app/sneaker.php but this doesn’t meter because I tried with two addresses also.
So, the solution for me was to add a foreach in capture($exception) function , class Sneaker.php:

private function capture($exception)
{
    $recipients = $this->config->get('sneaker.to');

    $subject = $this->handler->convertExceptionToString($exception);

    $body = $this->handler->convertExceptionToHtml($exception);

    foreach ($recipients as $recipient) {
        $this->mailer->to($recipient)->send(new ExceptionMailer($subject, $body));
    }
}

Can you correct this function?

Laravel version 5.3.6!

Thanks

@trinca trinca changed the title local.ERROR: Exception thrown in Sneaker when capturing an exception (ErrorException: Trying to get property of non-object) Exception thrown in Sneaker when capturing an exception (ErrorException: Trying to get property of non-object) Aug 30, 2017
@trinca
Copy link
Author

trinca commented Aug 30, 2017

local.ERROR: exception 'ErrorException' with message 'Trying to get property of non-object' in /var/www/html/simdev/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php:376
Stack trace:
#0 /var/www/html/simdev/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php(376): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8, 'Trying to get p...', '/var/www/html/s...', 376, Array)
#1 /var/www/html/simdev/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php(321): Illuminate\Mail\Mailable->setAddress(Array, NULL, 'to')
#2 /var/www/html/simdev/vendor/laravel/framework/src/Illuminate/Mail/MailableMailer.php(138): Illuminate\Mail\Mailable->to(Array)
#3 /var/www/html/simdev/vendor/laravel/framework/src/Illuminate/Mail/MailableMailer.php(121): Illuminate\Mail\MailableMailer->fill(Object(SquareBoat\Sneaker\ExceptionMailer))
#4 /var/www/html/simdev/vendor/laravel/framework/src/Illuminate/Mail/MailableMailer.php(96): Illuminate\Mail\MailableMailer->queue(Object(SquareBoat\Sneaker\ExceptionMailer))
#5 /var/www/html/simdev/vendor/squareboat/sneaker/src/Sneaker.php(111): Illuminate\Mail\MailableMailer->send(Object(SquareBoat\Sneaker\ExceptionMailer))
#6 /var/www/html/simdev/vendor/squareboat/sneaker/src/Sneaker.php(81): SquareBoat\Sneaker\Sneaker->capture(Object(ErrorException))
#7 /var/www/html/simdev/app/Exceptions/Handler.php(47): SquareBoat\Sneaker\Sneaker->captureException(Object(ErrorException))
#8 /var/www/html/simdev/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(79): App\Exceptions\Handler->report(Object(ErrorException))
#9 /var/www/html/simdev/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(55): Illuminate\Routing\Pipeline->handleException(Object(Illuminate\Http\Request), Object(ErrorException))
#10 /var/www/html/simdev/app/Http/Middleware/RedirectIfNoStudentCompany.php(32): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))
#11 /var/www/html/simdev/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(137): App\Http\Middleware\RedirectIfNoStudentCompany->handle(Object(Illuminate\Http\Request), Object(Closure))

@akaamitgupta
Copy link
Contributor

@trinca Can you specify which version of Laravel you are using?

Can you also check if from key is set in file config/mail.php?

@trinca
Copy link
Author

trinca commented Oct 20, 2017

Laravel version 5.3.6!

Yes the from key is set.

@akaamitgupta
Copy link
Contributor

@trinca Closing this issue for now. If you face the issue again then feel free to open it again.

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

No branches or pull requests

2 participants