jimingham wrote:

> > > raise an exception in the decorator if the CRO has an error ?
> > 
> > 
> > `GetError()` can returning strings prefixed by "warning: ", so those 
> > shouldn't be raised as an exception. Should the decorator have differing 
> > behavior, print for non-errors, raise for errors?
> 
> Sounds good. IMO if `warning:` shouldn't be reported as an error in the 
> CommandReturnObject but rather as a regular output. This is a bit orthogonal 
> to this PR but still wondering what @jimingham thinks of this.

The real way to tell whether an SBCommandReturnObject is for a command that got 
an error or not is to check `result.GetStatus()`.  If you see 
`lldb.eReturnStatusFailed`, then that's a failure.  Anything else is a success. 
 If you use AppendError when setting an error in a return object, it 
automatically sets the status to `eReturnStatusFailed`.

https://github.com/llvm/llvm-project/pull/195351
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to