ks3dev / roottools

Automatically exported from code.google.com/p/roottools
0 stars 0 forks source link

Improve error management: Executer.sendShell, Result and error output #10

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
First of all, thank you very much from the great work you are doing with this 
very useful roottools library :)

I saw that you implement an error management using errorStream in 
Executer.sendShell. That's great thing that was missing but the problem is that 
standard and error output are mixed which makes them difficult to manage.

I'd suggest to update the Result object by adding a "processError" that will be 
called by Executer.sendShell for errors:
-> process for standard output (inputStream)
-> processError for errors (errorStream)
That would makes it much easyer to use!

Original issue reported on code.google.com by LRenault...@gmail.com on 14 Nov 2011 at 5:56

GoogleCodeExporter commented 9 years ago
Sorry, it's not a defect but an Enhancement (I don't know how to modify the 
type of the issue)

Original comment by LRenault...@gmail.com on 14 Nov 2011 at 5:58

GoogleCodeExporter commented 9 years ago
So sometimes the outputs will contain the same information? (duplicated)

So the request is to process errorStream separately in the Result Object right?

Original comment by Stericso...@gmail.com on 14 Nov 2011 at 6:05

GoogleCodeExporter commented 9 years ago

Original comment by Stericso...@gmail.com on 14 Nov 2011 at 6:08

GoogleCodeExporter commented 9 years ago
I don't think it will make duplicates but as an example:
- If I send a "ls /system" with success, it will return me the list of files 
and directory through inputstream.
- If I send a "ls /sistem" it will return me an error "ls: /sistem: No such 
file or directory" through errorStream.

In the current state of your process method (correct me if I'm wrong), I can 
not identify if the message is actually a regular output (result of the 
command) or an error returned by the command.

So yes, the request would be to process errorStream separatly through a new 
method (processError?) or a parameter in process indicating if the current 
message is a regular output or an error output ^_^

Original comment by LRenault...@gmail.com on 14 Nov 2011 at 6:17

GoogleCodeExporter commented 9 years ago
Ah, great example. I will implement this.

Original comment by Stericso...@gmail.com on 14 Nov 2011 at 7:02

GoogleCodeExporter commented 9 years ago
I made a commit, can you tell me if this satisfies your request?

Original comment by Stericso...@gmail.com on 14 Nov 2011 at 7:19

GoogleCodeExporter commented 9 years ago
Your commit fully satisfy my request, thank you very much :)

Original comment by LRenault...@gmail.com on 14 Nov 2011 at 8:48

GoogleCodeExporter commented 9 years ago
Great, I will roll this out to stable and push out RootTools 1.4 this week then.

Original comment by Stericso...@gmail.com on 14 Nov 2011 at 11:11