ngs icon indicating copy to clipboard operation
ngs copied to clipboard

Add a way to indicate that anything on stderr of external program is an exception

Open ilyash-b opened this issue 5 years ago • 3 comments

Hello tsort !

If the graph contains a cycle (and therefore cannot be properly sorted), one of the arcs in the cycle is ignored and the sort continues. Cycles are reported on standard error.

... and exit code is still zero

ilyash-b avatar Apr 19 '19 04:04 ilyash-b

Initiall thought:

F finished_ok(p:Process) {
	ok = p.command.options.get('ok')
	guard ok is Fun
	ok(p)
}

but then how is it that ok:[1,2] refers to exit code while ok:mymethod will get Process argument?

Maybe something like Pred is needed for ok: argument.

If the above is implemented then: $(ok:F(p) p.stderr.not() and p.finished_ok() blah} - which is not very readable. Maybe putting a lambda inside $(...) is not that great of an idea.

ilyash-b avatar Apr 19 '19 04:04 ilyash-b

Thoughts:

stderr_exception: options sound ok.

  • true will cause any output to be treated as exception
  • RegExp will do the obvious thing

Using ~ (match) operator is possible (to be applied to stdout and the value of the stderr_exception: option). Need to think how to indicate non-empty string then.

ilyash-b avatar Apr 22 '19 12:04 ilyash-b

Requirements:

  • stdout, stderr and other arbitrary file descriptors should be possible to check
  • consistent option naming, starting with ok_
  • possible checks should include: empty string, substring search, regexp match
  • positive and negative checks

ilyash-b avatar Apr 25 '19 05:04 ilyash-b