Skip to content
This repository has been archived by the owner on Jan 19, 2023. It is now read-only.

Clean up output from vanilla addon-json #30

Open
charrondev opened this issue Oct 20, 2017 · 1 comment
Open

Clean up output from vanilla addon-json #30

charrondev opened this issue Oct 20, 2017 · 1 comment
Assignees

Comments

@charrondev
Copy link
Contributor

Currently 1 error can actually display multiple times. An example of the errors when 1 theme is missing "type": "theme".

Output
PHP Notice:  The addon in /themes/bigfish has 1 issues. in /www/vanilla/library/Vanilla/Addon.php on line 787
PHP Stack trace:
PHP   1. {main}() /git/vanilla-cli/bin/vanilla:0
PHP   2. Vanilla\Cli\Cli->run() /git/vanilla-cli/bin/vanilla:41
PHP   3. Vanilla\Cli\Cli->dispatch() /git/vanilla-cli/src/Vanilla/Cli/Cli.php:71
PHP   4. Vanilla\Cli\Command\AddonJsonCmd->run() /git/vanilla-cli/src/Vanilla/Cli/Cli.php:56
PHP   5. Vanilla\Cli\Command\AddonJsonCmd->doRun() /git/vanilla-cli/src/Vanilla/Cli/Command/AddonCommandBase.php:58
PHP   6. Vanilla\AddonManager->scan() /git/vanilla-cli/src/Vanilla/Cli/Command/AddonJsonCmd.php:48
PHP   7. Vanilla\Addon->__construct() /www/vanilla/library/Vanilla/AddonManager.php:323
PHP   8. Vanilla\Addon->scan() /www/vanilla/library/Vanilla/Addon.php:67
PHP   9. Vanilla\Addon->check() /www/vanilla/library/Vanilla/Addon.php:116
PHP  10. Vanilla\Addon->triggerIssues() /www/vanilla/library/Vanilla/Addon.php:771
PHP  11. trigger_error() /www/vanilla/library/Vanilla/Addon.php:787
PHP Notice:  The type info field is required. in /www/vanilla/library/Vanilla/Addon.php on line 789
PHP Stack trace:
PHP   1. {main}() /git/vanilla-cli/bin/vanilla:0
PHP   2. Vanilla\Cli\Cli->run() /git/vanilla-cli/bin/vanilla:41
PHP   3. Vanilla\Cli\Cli->dispatch() /git/vanilla-cli/src/Vanilla/Cli/Cli.php:71
PHP   4. Vanilla\Cli\Command\AddonJsonCmd->run() /git/vanilla-cli/src/Vanilla/Cli/Cli.php:56
PHP   5. Vanilla\Cli\Command\AddonJsonCmd->doRun() /git/vanilla-cli/src/Vanilla/Cli/Command/AddonCommandBase.php:58
PHP   6. Vanilla\AddonManager->scan() /git/vanilla-cli/src/Vanilla/Cli/Command/AddonJsonCmd.php:48
PHP   7. Vanilla\Addon->__construct() /www/vanilla/library/Vanilla/AddonManager.php:323
PHP   8. Vanilla\Addon->scan() /www/vanilla/library/Vanilla/Addon.php:67
PHP   9. Vanilla\Addon->check() /www/vanilla/library/Vanilla/Addon.php:116
PHP  10. Vanilla\Addon->triggerIssues() /www/vanilla/library/Vanilla/Addon.php:771
PHP  11. trigger_error() /www/vanilla/library/Vanilla/Addon.php:789
=== AddonManager's warnings ===

Notice: The addon in /themes/bigfish has 1 issues. in /www/vanilla/library/Vanilla/Addon.php on line 787

Call Stack:
    0.0003     357192   1. {main}() /git/vanilla-cli/bin/vanilla:0
    0.0106     731272   2. Vanilla\Cli\Cli->run() /git/vanilla-cli/bin/vanilla:41
    0.0113     751144   3. Vanilla\Cli\Cli->dispatch() /git/vanilla-cli/src/Vanilla/Cli/Cli.php:71
    0.0114     751144   4. Vanilla\Cli\Command\AddonJsonCmd->run() /git/vanilla-cli/src/Vanilla/Cli/Cli.php:56
    0.0264    2121832   5. Vanilla\Cli\Command\AddonJsonCmd->doRun() /git/vanilla-cli/src/Vanilla/Cli/Command/AddonCommandBase.php:58
    1.0479    2144048   6. Vanilla\AddonManager->scan() /git/vanilla-cli/src/Vanilla/Cli/Command/AddonJsonCmd.php:48
    1.1674    2578576   7. Vanilla\Addon->__construct() /www/vanilla/library/Vanilla/AddonManager.php:323
    1.1674    2578576   8. Vanilla\Addon->scan() /www/vanilla/library/Vanilla/Addon.php:67
    1.1722    2583824   9. Vanilla\Addon->check() /www/vanilla/library/Vanilla/Addon.php:116
    1.1723    2585056  10. Vanilla\Addon->triggerIssues() /www/vanilla/library/Vanilla/Addon.php:771
    1.1723    2585136  11. trigger_error() /www/vanilla/library/Vanilla/Addon.php:787


Notice: The type info field is required. in /www/vanilla/library/Vanilla/Addon.php on line 789

Call Stack:
    0.0003     357192   1. {main}() /git/vanilla-cli/bin/vanilla:0
    0.0106     731272   2. Vanilla\Cli\Cli->run() /git/vanilla-cli/bin/vanilla:41
    0.0113     751144   3. Vanilla\Cli\Cli->dispatch() /git/vanilla-cli/src/Vanilla/Cli/Cli.php:71
    0.0114     751144   4. Vanilla\Cli\Command\AddonJsonCmd->run() /git/vanilla-cli/src/Vanilla/Cli/Cli.php:56
    0.0264    2121832   5. Vanilla\Cli\Command\AddonJsonCmd->doRun() /git/vanilla-cli/src/Vanilla/Cli/Command/AddonCommandBase.php:58
    1.0479    2144048   6. Vanilla\AddonManager->scan() /git/vanilla-cli/src/Vanilla/Cli/Command/AddonJsonCmd.php:48
    1.1674    2578576   7. Vanilla\Addon->__construct() /www/vanilla/library/Vanilla/AddonManager.php:323
    1.1674    2578576   8. Vanilla\Addon->scan() /www/vanilla/library/Vanilla/Addon.php:67
    1.1722    2583824   9. Vanilla\Addon->check() /www/vanilla/library/Vanilla/Addon.php:116
    1.1723    2585056  10. Vanilla\Addon->triggerIssues() /www/vanilla/library/Vanilla/Addon.php:771
    1.1733    2585056  11. trigger_error() /www/vanilla/library/Vanilla/Addon.php:789

Here we have

  • A notice that there was 1 error for the addon
  • A callstack for that notice
  • A notice of what that error was
  • A callstack for that notice
  • The same errors and callstacks again

Really this should just be:

1 Addon has 1 issue

The addon in /themes/bigfish has 1 issue
    - The type info field is required

The callstacks really shouldn't be visible they don't provide any relevant context here as far as I can tell.

@DaazKu
Copy link
Contributor

DaazKu commented Oct 20, 2017

Having the whole callstack is indeed not super relevant but having at least from where the error was raised is.
PHP 11. trigger_error() /www/vanilla/library/Vanilla/Addon.php:789 <- is priceless since the raised errors are not always that easy to understand.

@charrondev charrondev self-assigned this May 3, 2018
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