tylercd100/lern

Wrong params error

dragonfire1119 opened this issue · 3 comments

Drivers:

  • Mail
  • Slack

Error:

Symfony\Component\Debug\Exception\FatalErrorException:/home/vagrant/Code/laravel/vendor/tylercd100/lern/src/Components/Recorder.php:59 Uncaught Error: Wrong parameters for Tylercd100\LERN\Exceptions\RecorderFailedException([string $message [, long $code [, Throwable $previous = NULL]]]) in /home/vagrant/Code/laravel/vendor/tylercd100/lern/src/Components/Recorder.php:59
Stack trace:
#0 /home/vagrant/Code/laravel/vendor/tylercd100/lern/src/Components/Recorder.php(59): Exception->__construct('SQLSTATE[HY000]...', 'HY000', Object(Illuminate\Database\QueryException))
#1 /home/vagrant/Code/laravel/vendor/tylercd100/lern/src/LERN.php(67): Tylercd100\LERN\Components\Recorder->record(Object(Illuminate\Database\QueryException))
#2 /home/vagrant/Code/laravel/vendor/tylercd100/lern/src/LERN.php(56): Tylercd100\LERN\LERN->record(Object(Symfony\Component\Debug\Exception\FatalThrowableError))
#3 /home/vagrant/Code/laravel/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(218): Tylercd100\LERN\LERN->handle(Object(Symfony\Component\Debug\Exception\FatalThrowableError))
#4 /home/vagrant/Code/laravel/app/Exceptions/Handler.php(75): Illum

Trace: #0 {main}

LERN Setup in Handler:

if ($this->shouldReport($e)) {
            //Change the subject
            LERN::setSubject("An Exception was thrown!");

            //Change the message body
            LERN::setMessage(function($exception){
                $msg = "";

                //Get the route
                $url = Request::url();
                $method = Request::method();
                if($url) {
                    $msg.="URL: {$method}@{$url}".PHP_EOL;
                }

                //Get the User
                $user = Auth::user();
                if($user) {
                    $msg.="User: #{$user->id} {$user->first_name} {$user->last_name}".PHP_EOL;
                }

                //Exception
                $msg.=get_class($exception).":{$exception->getFile()}:{$exception->getLine()} {$exception->getMessage()}".PHP_EOL;

                //Input
                $input = Input::all();
                if(!empty($input)){
                    $msg.="Data: ".json_encode($input).PHP_EOL;
                }

                //Trace
                $msg.=PHP_EOL."Trace: {$exception->getTraceAsString()}";
                return $msg;
            });

            LERN::handle($e);

How to produce the error:

  • Miss spell the $this->middleware('aut'); in the controller __construct.

Database pertaining to the error:

  • Mysql: success
  • sqlite: error

Awesome, thank you @dragonfire1119 I will have fix for this soon

Hey @dragonfire1119 give the new release a try (3.1.4)

@tylercd100 seems that (3.1.4) fixed it. Ill let you know if I find anymore bugs. Thanks for your time in fixing the bug.