Welcome Guest, Not a member yet? Register   Sign In
Spark db:seed
#1

(This post was last modified: 08-29-2022, 06:02 PM by iRedds.)

If you call the php spark db:seed command on a file that does not exist, an exception is thrown (For what?) and, along with the error text, a backtrace is also displayed.
It seems to me that such behavior in the console looks terrible.

Code:
php spark db:seed 11

CodeIgniter v4.2.5 Command Line Tool - Server Time: 2022-08-29 19:49:44 UTC-05:00


[InvalidArgumentException]

The specified seeder is not a valid file: D:\dev\CodeIgniter4\app\Database/Seeds/11.php

at SYSTEMPATH\Database\Seeder.php:130

Backtrace:
  1    SYSTEMPATH\Commands\Database\Seed.php:77
      CodeIgniter\Database\Seeder()->call()

  2    SYSTEMPATH\CLI\Commands.php:63
      CodeIgniter\Commands\Database\Seed()->run()

  3    SYSTEMPATH\CLI\CommandRunner.php:65
      CodeIgniter\CLI\Commands()->run()

  4    SYSTEMPATH\CLI\CommandRunner.php:51
      CodeIgniter\CLI\CommandRunner()->index()

  5    SYSTEMPATH\CodeIgniter.php:897
      CodeIgniter\CLI\CommandRunner()->_remap()

  6    SYSTEMPATH\CodeIgniter.php:457
      CodeIgniter\CodeIgniter()->runController()

  7    SYSTEMPATH\CodeIgniter.php:336
      CodeIgniter\CodeIgniter()->handleRequest()

  8    SYSTEMPATH\CLI\Console.php:48
      CodeIgniter\CodeIgniter()->run()

  9    ROOTPATH\spark:98
      CodeIgniter\CLI\Console()->run()
Reply
#2

That would be a good candidate for an exception catch and a custom error output, for sure. Nice "catch" Wink
Reply




Theme © iAndrew 2016 - Forum software by © MyBB