ngs-lang / ngs

Next Generation Shell (NGS)
https://ngs-lang.org/
GNU General Public License v3.0
1.49k stars 41 forks source link

Unclear error message when sub-subcommand is not given #599

Closed ilyash-b closed 4 months ago

ilyash-b commented 2 years ago

Source of ngsfile:

ns {
  run = ns { ... }
}

The error should be cleaner

$ ngs . run 
[ERROR 2022-10-11 18:34:45 +04] +----------------------------------------------+
[ERROR 2022-10-11 18:34:45 +04] | shift(arr:Arr) failed because of empty array |
[ERROR 2022-10-11 18:34:45 +04] +----------------------------------------------+
[ERROR 2022-10-11 18:34:45 +04] Exception of type EmptyArrayFail occurred
[ERROR 2022-10-11 18:34:45 +04] Info: message = String of length 44: shift(arr:Arr) failed because of empty array
[ERROR 2022-10-11 18:34:45 +04] Frame 0: <builtin-stdlib>:8148:2 - 8148:35
[ERROR 2022-10-11 18:34:45 +04] Frame 1: <builtin-stdlib>:8122:21 - 8122:30 [in bootstrap_exception_catch_wrapper]
[ERROR 2022-10-11 18:34:45 +04] Frame 2: <builtin-stdlib>:8052:7 - 8057:8 [in bootstrap]
[ERROR 2022-10-11 18:34:45 +04] Frame 3: <builtin-stdlib>:8056:8 - 8056:22 [in <catch-clause-1>]
[ERROR 2022-10-11 18:34:45 +04] Frame 4: <builtin-stdlib>:8046:35 - 8046:49 [in run_subcommand]
[ERROR 2022-10-11 18:34:45 +04] Frame 5: <builtin-stdlib>:8042:22 - 8042:27 [in run_subcommand]
+----------------------------------------------+
| shift(arr:Arr) failed because of empty array |
+----------------------------------------------+
ilyash-b commented 4 months ago

Already solved